diff options
Diffstat (limited to '')
-rw-r--r-- | app/view/404.php | 41 | ||||
-rw-r--r-- | app/view/administration.php | 38 | ||||
-rw-r--r-- | app/view/dashboard.php | 38 | ||||
-rw-r--r-- | app/view/datalsts.php | 137 | ||||
-rw-r--r-- | app/view/datamods.php | 168 | ||||
-rw-r--r-- | app/view/dbconfig.php | 86 | ||||
-rw-r--r-- | app/view/deleteaccount.php | 60 | ||||
-rw-r--r-- | app/view/except.php | 46 | ||||
-rw-r--r-- | app/view/formctrl.php | 73 | ||||
-rw-r--r-- | app/view/group.php | 57 | ||||
-rw-r--r-- | app/view/groups.php | 55 | ||||
-rw-r--r-- | app/view/issue.php | 174 | ||||
-rw-r--r-- | app/view/login.php | 117 | ||||
-rw-r--r-- | app/view/pad.php | 60 | ||||
-rw-r--r-- | app/view/pads.php | 55 | ||||
-rw-r--r-- | app/view/settings.php | 219 | ||||
-rw-r--r-- | app/view/stdpage.php | 266 |
17 files changed, 1690 insertions, 0 deletions
diff --git a/app/view/404.php b/app/view/404.php new file mode 100644 index 0000000..95f4835 --- /dev/null +++ b/app/view/404.php @@ -0,0 +1,41 @@ +<?php + +/* + * SCROTT 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 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. + * + * For more information, please refer to UNLICENSE + */ + +require_once "view/stdpage.php"; + +?> + +<!DOCTYPE html> + +<html lang="en"> + <head> + <?=stdpage\head( "Page not found" )?> + </head> + + <body> + <?=stdpage\top()?> + + <div class="container"> + <div class="jumbotron text-center"> + <h1>Page not found</h1> + + <a href="<?=ar()?>/" class="btn btn-primary btn-lg"> + <span class="glyphicon glyphicon-pencil"></span> Go to Scrott Dashboard + </a> + </div> + </div> + + <?=stdpage\foot()?> + </body> +</html> diff --git a/app/view/administration.php b/app/view/administration.php new file mode 100644 index 0000000..e5af14a --- /dev/null +++ b/app/view/administration.php @@ -0,0 +1,38 @@ +<?php + +/* + * SCROTT 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 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. + * + * For more information, please refer to UNLICENSE + */ + +require_once "view/stdpage.php"; + +?> + +<!DOCTYPE html> + +<html lang="en"> + <head> + <?=stdpage\head( "Administration" )?> + </head> + + <body> + <?=stdpage\top()?> + <?=stdpage\nav()?> + + <div class="container"> + <div class="jumbotron text-center"> + Welcome to the admin panel. There is no content yet. + </div> + </div> + + <?=stdpage\foot()?> + </body> +</html> diff --git a/app/view/dashboard.php b/app/view/dashboard.php new file mode 100644 index 0000000..7b34e9f --- /dev/null +++ b/app/view/dashboard.php @@ -0,0 +1,38 @@ +<?php + +/* + * SCROTT 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 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. + * + * For more information, please refer to UNLICENSE + */ + +require_once "view/stdpage.php"; + +?> + +<!DOCTYPE html> + +<html lang="en"> + <head> + <?=stdpage\head( "Dashboard" )?> + </head> + + <body> + <?=stdpage\top()?> + <?=stdpage\nav()?> + + <div class="container"> + <div class="jumbotron text-center"> + Welcome to the dashboard. There is no content yet. + </div> + </div> + + <?=stdpage\foot()?> + </body> +</html> diff --git a/app/view/datalsts.php b/app/view/datalsts.php new file mode 100644 index 0000000..2bbb44e --- /dev/null +++ b/app/view/datalsts.php @@ -0,0 +1,137 @@ +<?php + +/* + * SCROTT 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 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. + * + * For more information, please refer to UNLICENSE + */ + +namespace datalsts; + +require_once "class/obj.class.php"; +require_once "class/stage.class.php"; +require_once "class/issue.class.php"; + +?> +<?php function objHeadCircle(\obj $obj, int $height) : void { ?> + + <?php require "model/objHeadCircle.php"; ?> + <img src="<?=$src?>" alt="<?=$alt?>" title="<?=$alt?>" class="img-circle" height="<?=$height?>" /> + +<?php } ?> +<?php function objBgPrev(\obj $obj, int $height) : void { ?> + + <?php require "model/objBgPrev.php"; ?> + <img src="<?=$src?>" alt="<?=$alt?>" title="<?=$alt?>" class="img-rounded" height="<?=$height?>" /> + +<?php } ?> +<?php function gpListItem(\obj $obj) : void { ?> + + <?php require "model/gpListItem.php"; ?> + + <a href="<?=$url?>" style="color: #000; text-decoration: none;"> + <div class="panel panel-default"> + <div class="panel-body"> + <div class="row"> + <div class="col-md-12"> + <span class="glyphicon <?=$glyph?>"></span> <?=$own_name?> / <?=$obj_name?> + <!--TODO stats on pad/issue counts--> + </div> + </div> + + <div class="visible-lg-block"> + <?=objHeadCircle($owner, 25)?> + + <?php if ($numb_membs) { ?> + <span class="glyphicon glyphicon-plus"></span> + <?php } ?> + + <?php foreach ($membs_lg as $memb) { ?> + <?=objHeadCircle($memb, 25)?> + <?php } ?> + + <?php if ($numb_membs > 18) { ?> + <span class="glyphicon glyphicon-option-horizontal"></span> + <?php } ?> + </div> + + <div class="visible-md-block"> + <?=objHeadCircle($owner, 25)?> + + <?php if ($numb_membs) { ?> + <span class="glyphicon glyphicon-plus"></span> + <?php } ?> + + <?php foreach ($membs_md as $memb) { ?> + <?=objHeadCircle($memb, 25)?> + <?php } ?> + + <?php if ($numb_membs > 18) { ?> + <span class="glyphicon glyphicon-option-horizontal"></span> + <?php } ?> + </div> + + <div class="visible-sm-block"> + <?=objHeadCircle($owner, 25)?> + + <?php if ($numb_membs) { ?> + <span class="glyphicon glyphicon-plus"></span> + <?php } ?> + + <?php foreach ($membs_sm as $memb) { ?> + <?=objHeadCircle($memb, 25)?> + <?php } ?> + + <?php if ($numb_membs > 18) { ?> + <span class="glyphicon glyphicon-option-horizontal"></span> + <?php } ?> + </div> + + <div class="visible-xs-block"> + <?=objHeadCircle($owner, 25)?> + + <?php if ($numb_membs) { ?> + <span class="glyphicon glyphicon-plus"></span> + <?php } ?> + + <?php foreach ($membs_xs as $memb) { ?> + <?=objHeadCircle($memb, 25)?> + <?php } ?> + + <?php if ($numb_membs > 18) { ?> + <span class="glyphicon glyphicon-option-horizontal"></span> + <?php } ?> + </div> + </div> + </div> + </a> + +<?php } ?> +<?php function stageListItem(\stage $s) : void { ?> + + <div class="panel panel-default"> + <h2 class="text-center"><?=$s->name?></h2> + + <table class="table table-hover"> + <?php foreach ($s->getIssues_ordByDueByNumb() as $i) { ?> + <?=issueListItem($i)?> + <?php } ?> + </table> + </div> + +<?php } ?> +<?php function issueListItem(\issue $i) : void { ?> + + <tr class="issueListItem" data-guid="<?=$i->guid?>"> + <!-- TODO --> + <td class="col-md-2"><?=$i->guid?> (#<?=$i->numb?>)</td> + <td class="col-md-10"><?=$i->name?></td> + </tr> + +<?php } ?> diff --git a/app/view/datamods.php b/app/view/datamods.php new file mode 100644 index 0000000..921002c --- /dev/null +++ b/app/view/datamods.php @@ -0,0 +1,168 @@ +<?php + +/* + * SCROTT 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 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. + * + * For more information, please refer to UNLICENSE + */ + +namespace datamods; + +require_once "model/datamods.php"; +require_once "view/formctrl.php"; +require_once "class/user.class.php"; + +?> +<?php function newGroup() : void { ?> + + <div id="newGroupModal" class="modal fade" tabindex="-1" role="dialog"> + <div class="modal-dialog modal-sm" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal"> + <span aria-hidden="true">×</span> + </button> + + <h4 class="modal-title"> + <span class="glyphicon glyphicon-th"></span> Create new Group + </h4> + </div> + + <div class="modal-body"> + <form method="post" action="<?=ap()?>"> + <?=\formctrl\formname( "dm-group-add" )?> + + <div class="form-group"> + <label>Owner</label> + + <select class="form-control selectpicker"> + <optgroup label="Users"> + <option data-icon="glyphicon-user"> + <?=\user::getCurrent()->getDisplayName()?> + </option> + </optgroup> + </select> + </div> + + <?=\formctrl\text( "Group Name", "name" )?> + + <button type="submit" class="btn btn-success pull-right"> + <span class="glyphicon glyphicon-plus"></span> Add + </button> + + <p> </p> + </form> + </div> + </div> + </div> + </div> + +<?php } ?> +<?php function newPad() : void { ?> + + <div id="newPadModal" class="modal fade" tabindex="-1" role="dialog"> + <div class="modal-dialog modal-sm" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal"> + <span aria-hidden="true">×</span> + </button> + + <h4 class="modal-title"> + <span class="glyphicon glyphicon-edit"></span> Create new Pad + </h4> + </div> + + <div class="modal-body"> + <form method="post" action="<?=ap()?>"> + <?=\formctrl\formname( "dm-pad-add" )?> + + <div class="form-group"> + <label>Owner</label> + + <select name="input[owner]" class="form-control selectpicker"> + <optgroup label="Users"> + <option data-icon="glyphicon-user" value="<?=\user::getCurrent()->guid?>"> + <?=\user::getCurrent()->getDisplayName()?> + </option> + </optgroup> + + <optgroup label="Groups"> + <?php foreach (\user::getCurrent()->getGroups_ordByOwnByName() as $g) { ?> + <?php if (\user::getCurrent()->canCreateSub($g)) { ?> + <option data-icon="glyphicon-th" value="<?=$g->guid?>"> + <?=$g->getDisplayName()?> + </option> + <?php } ?> + <?php } ?> + </optgroup> + </select> + </div> + + <?=\formctrl\text( "Pad Name", "name" )?> + + <button type="submit" class="btn btn-success pull-right"> + <span class="glyphicon glyphicon-plus"></span> Add + </button> + + <p> </p> + </form> + </div> + </div> + </div> + </div> + +<?php } ?> +<?php function newIssue() : void { ?> + + <?php $p = getPageObj(); ?> + + <div id="newIssueModal" class="modal fade" tabindex="-1" role="dialog"> + <div class="modal-dialog" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal"> + <span aria-hidden="true">×</span> + </button> + + <h4 class="modal-title"> + <span class="glyphicon glyphicon-inbox"></span> Open new Issue + </h4> + </div> + + <div class="modal-body"> + <?php if (count($p->getStages()) == 0) { ?> + <div class="well well-sm text-center text-danger"> + <h3><?=$p->name?> doesn't have any stages</h3> + </div> + <?php } else { ?> + <h4> + <span class="glyphicon glyphicon-tasks"></span> + <?=$p->getStages()[0]->name?> + </h4> + + <form method="post" action="<?=ap()?>"> + <?=\formctrl\formname( "dm-issue-add" )?> + <?=\formctrl\hidden( "pad", $p->guid )?> + <?=\formctrl\text( "Subject", "name" )?> + <?=\formctrl\textarea( "Description", "mesg", 15 )?> + + <button type="submit" class="btn btn-success pull-right"> + <span class="glyphicon glyphicon-plus"></span> Open + </button> + + <p> </p> + </form> + <?php } ?> + </div> + </div> + </div> + </div> + +<?php } ?> diff --git a/app/view/dbconfig.php b/app/view/dbconfig.php new file mode 100644 index 0000000..a8d8bce --- /dev/null +++ b/app/view/dbconfig.php @@ -0,0 +1,86 @@ +<?php + +/* + * SCROTT 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 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. + * + * For more information, please refer to UNLICENSE + */ + +require_once "model/dbconfig.php"; +require_once "view/stdpage.php"; +require_once "view/formctrl.php"; + +?> + +<!DOCTYPE html> + +<html lang="en"> + <head> + <?=stdpage\head( "Database Configuration" )?> + </head> + + <body> + <?=stdpage\top()?> + + <div class="container"> + <div class="jumbotron"> + <h2 class="text-center"> + <span class="glyphicon glyphicon-user"></span> + <span class="glyphicon glyphicon-th"></span> + <span class="glyphicon glyphicon-edit"></span> + <span class="glyphicon glyphicon-tasks"></span> + <span class="glyphicon glyphicon-inbox"></span> + <span class="glyphicon glyphicon-envelope"></span> + </h2> + + <h1 class="text-center">Welcome to Scrott!</h1> + <hr /> + + <p class="text-center">You're seeing this page because the file "dbconfig.php" is missing.</p> + <p class="text-center">Please fill out the form below to configure Scrott to use your database.</p> + <hr /> + + <p class="text-center">This form will save your database parameters to the configuration file.<br /> + Scrott needs this information before it can begin working!</p> + + <h5 class="text-center text-danger"> + It is presumed that you are the administrator for this Scrott install.<br /> + There is a security risk involved with exposing this page to the public! + </h5> + + <div class="row"> + <div class="col-md-2"></div> + + <div class="col-md-8"> + <div class="panel panel-default"> + <div class="panel-body"> + <form method="post" action="<?=ap()?>"> + <?=formctrl\formname( "save" )?> + <?=formctrl\text( "Engine", "dbEngine", "MySQL", "", false, true )?> + <?=formctrl\text( "Hostname", "dbHost", "", "localhost" )?> + <?=formctrl\text( "Username", "dbUname", "", "root" )?> + <?=formctrl\password( "Password", "dbPasswd", false )?> + <?=formctrl\text( "Database Name", "dbName", "", "db_scrott" )?> + + <button type="submit" class="btn btn-primary pull-right"> + Use these settings + </button> + </form> + </div> + </div> + </div> + + <div class="col-md-2"></div> + </div> + </div> + </div> + + <?=stdpage\foot()?> + </body> +</html> diff --git a/app/view/deleteaccount.php b/app/view/deleteaccount.php new file mode 100644 index 0000000..37c35a0 --- /dev/null +++ b/app/view/deleteaccount.php @@ -0,0 +1,60 @@ +<?php + +/* + * SCROTT 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 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. + * + * For more information, please refer to UNLICENSE + */ + +require_once "model/deleteaccount.php"; +require_once "view/stdpage.php"; +require_once "view/formctrl.php"; + +?> + +<!DOCTYPE html> + +<html lang="en"> + <head> + <?=stdpage\head( "Delete user account" )?> + </head> + + <body> + <?=stdpage\top()?> + <?=stdpage\nav()?> + + <div class="container"> + <div class="panel panel-danger"> + <div class="panel-heading"> + Warning: Deleting your user account! + </div> + + <div class="panel-body text-center"> + <form method="post" action="<?=ap()?>"> + <?=formctrl\formname( "deleteaccount" )?> + + <h1>Are you sure?!</h1> + <h4>Please confirm you want to delete your Scrott account. Type your current password in the box below and click the confirm button.</h4> + <h5 class="text-danger">This can not be undone</h5> + <br /> + + <?=formctrl\password( "Password", "passwd", false )?> + + <button type="submit" class="btn btn-danger btn-lg"> + <span class="glyphicon glyphicon-trash"></span> + Confirm Delete Account + </button> + </form> + </div> + </div> + </div> + + <?=stdpage\foot()?> + </body> +</html> diff --git a/app/view/except.php b/app/view/except.php new file mode 100644 index 0000000..766828a --- /dev/null +++ b/app/view/except.php @@ -0,0 +1,46 @@ +<?php + +/* + * SCROTT 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 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. + * + * For more information, please refer to UNLICENSE + */ + +require_once "view/stdpage.php"; + +?> + +<!DOCTYPE html> + +<html lang="en"> + <head> + <?=stdpage\head( "Application exception" )?> + </head> + + <body> + <?=stdpage\top()?> + + <div class="container"> + <div class="jumbotron text-center"> + <h1>Scrott derped</h1> + <h5>System internals reported this:</h5> + + <div class="well well-sm text-danger"> + <h3><?=$e->getMessage()?></h3> + </div> + + <a href="<?=ar()?>/" class="btn btn-primary btn-lg"> + <span class="glyphicon glyphicon-pencil"></span> Go to Scrott Dashboard + </a> + </div> + </div> + + <?=stdpage\foot()?> + </body> +</html> diff --git a/app/view/formctrl.php b/app/view/formctrl.php new file mode 100644 index 0000000..1a8348d --- /dev/null +++ b/app/view/formctrl.php @@ -0,0 +1,73 @@ +<?php + +/* + * SCROTT 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 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. + * + * For more information, please refer to UNLICENSE + */ + +namespace formctrl; + +?> +<?php function formname(string $name) : void { ?> + + <input type="hidden" name="action" value="<?=$name?>" /> + +<?php } ?> +<?php function hidden(string $name, string $value) : void { ?> + + <input type="hidden" name="input[<?=$name?>]" value="<?=$value?>" /> + +<?php } ?> +<?php function text(string $label, string $name, string $value = "", string $placeholder = "", + bool $required = true, bool $disabled = false, string $cls = "", ?string $help = NULL) : void { ?> + + <div class="form-group <?=$cls?>"> + <label class="control-label"><?=$label?></label> + <input type="text" name="input[<?=$name?>]" value="<?=$value?>" placeholder="<?=$placeholder?>" class="form-control" <?=($required ? "required" : "")?> <?=($disabled ? "disabled" : "")?> maxlength="64" /> + + <?php if ($help) { ?> + <span class="help-block"><?=$help?></span> + <?php } ?> + </div> + +<?php } ?> +<?php function textarea(string $label, string $name, int $rows, string $value = "") : void { ?> + + <div class="form-group"> + <label class="control-label"><?=$label?></label> + <textarea name="input[<?=$name?>]" class="form-control" rows="<?=$rows?>"><?=$value?></textarea> + </div> + +<?php } ?> +<?php function password(string $label, string $name, bool $required = true) : void {?> + + <div class="form-group"> + <label class="control-label"><?=$label?></label> + <input type="password" name="input[<?=$name?>]" class="form-control" <?=($required ? "required" : "")?> /> + </div> + +<?php } ?> +<?php function checkbox(string $label, string $name, bool $checked = false, bool $disabled = false, ?string $collapse = NULL) : void { ?> + + <div class="checkbox"> + <label <?=($collapse ? "data-toggle=\"collapse\" data-target=\"$collapse\"" : "")?>> + <input type="checkbox" name="input[<?=$name?>]" value="1" <?=($checked ? "checked" : "")?> <?=($disabled ? "disabled" : "")?> /> <?=$label?> + </label> + </div> + +<?php } ?> +<?php function file(string $label, string $name) : void { ?> + + <div class="form-group"> + <label class="control-label"><?=$label?></label> + <input type="file" name="<?=$name?>" /> + </div> + +<?php } ?> diff --git a/app/view/group.php b/app/view/group.php new file mode 100644 index 0000000..014a560 --- /dev/null +++ b/app/view/group.php @@ -0,0 +1,57 @@ +<?php + +/* + * SCROTT 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 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. + * + * For more information, please refer to UNLICENSE + */ + +require_once "model/group.php"; +require_once "view/stdpage.php"; +require_once "view/datalsts.php"; + +?> + +<!DOCTYPE html> + +<html lang="en"> + <head> + <?=stdpage\head( getPageName() )?> + </head> + + <body> + <?=stdpage\top()?> + <?=stdpage\nav()?> + + <div class="container"> + <div class="well well-lg"> + <div class="row"> + <div class="col-md-12"> + <h1> + <span class="glyphicon glyphicon-th"></span> + <?=$group->name?> + </h1> + </div> + </div> + </div> + + <?php if (!count($pads)) { ?> + <div class="jumbotron"> + <h2 class="text-center">No pads in <?=$group->name?></h2> + </div> + <?php } ?> + + <?php foreach ($pads as $p) { ?> + <?=datalsts\gpListItem($p)?> + <?php } ?> + </div> + + <?=stdpage\foot()?> + </body> +</html> diff --git a/app/view/groups.php b/app/view/groups.php new file mode 100644 index 0000000..dadb61e --- /dev/null +++ b/app/view/groups.php @@ -0,0 +1,55 @@ +<?php + +/* + * SCROTT 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 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. + * + * For more information, please refer to UNLICENSE + */ + +require_once "view/stdpage.php"; +require_once "view/datalsts.php"; + +?> + +<!DOCTYPE html> + +<html lang="en"> + <head> + <?=stdpage\head( "My Groups" )?> + </head> + + <body> + <?=stdpage\top()?> + <?=stdpage\nav()?> + + <div class="container"> + <div class="page-header"> + <h1> + My Groups + + <button type="button" class="btn btn-success pull-right" data-toggle="modal" data-target="#newGroupModal"> + <span class="glyphicon glyphicon-plus"></span> Create new + </button> + </h1> + </div> + + <?php if (!count(user::getCurrent()->getGroups_ordByOwnByName())) { ?> + <div class="jumbotron"> + <h2 class="text-center">You aren't part of any groups</h2> + </div> + <?php } ?> + + <?php foreach (user::getCurrent()->getGroups_ordByOwnByName() as $g) { ?> + <?=datalsts\gpListItem($g)?> + <?php } ?> + </div> + + <?=stdpage\foot()?> + </body> +</html> diff --git a/app/view/issue.php b/app/view/issue.php new file mode 100644 index 0000000..2d781ba --- /dev/null +++ b/app/view/issue.php @@ -0,0 +1,174 @@ +<?php + +/* + * SCROTT 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 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. + * + * For more information, please refer to UNLICENSE + */ + +namespace issue_v; + +require_once "model/issue.php"; +require_once "class/issue.class.php"; + +?> +<?php function userPanel(?\user $u, string $style, string $role, string $ts) : void { ?> + + <div class="<?=$style?>"> + <?php if (!$u) { ?> + <p class="text-center"> + <span class="glyphicon glyphicon-ban-circle"></span> + <?=$role?> + </p> + <?php } else { ?> + <table> + <tbody> + <tr> + <td><?=\datalsts\objHeadCircle($u, 30)?> </td> + + <td> + <?=$u->getDisplayName()?> + + <small> + <?=$role?> + <br /> + <?=$ts?> + </small> + </td> + </tr> + </tbody> + </table> + <?php } ?> + </div> + +<?php } ?> +<?php function issue(\issue $i) : void { ?> + + <?php $m = $i->getOPMesg(); ?> + + <div id="issueModal-<?=$i->guid?>" class="modal fade" tabindex="-1" role="dialog"> + <div class="modal-dialog modal-lg" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal"> + <span aria-hidden="true">×</span> + </button> + + <h4 class="modal-title"> + <span class="glyphicon glyphicon-inbox"></span> + <?=$i->name?> + <small>#<?=$i->numb?></small> + </h4> + </div> + + <div class="modal-body"> + <div class="row"> + <div class="col-md-8"> + <p><?=$m->renderMesg()?></p> + + <hr /> + + <?php foreach ($i->getMesgs_ordByDatetime() as $rm) { ?> + <div class="panel panel-default"> + <div class="panel-body"> + <?php if ($rm->objtype == "mesg") { ?> + <div class="row"> + <div class="col-xs-1"> + <?=\datalsts\objHeadCircle($rm->getAuthor(), 40)?> + </div> + + <div class="col-xs-11"> + <strong><?=$rm->getAuthor()->getDisplayName()?></strong> + <small><?=$rm->created?></small> + <br /> + <?=$rm->renderMesg()?> + + <?php if ($rm->getAttachment()) { ?> + <br /> + <br /> + + <a href="<?=$rm->getAttachment()?>" class="btn btn-info"> + <span class="glyphicon glyphicon-save"></span> + <?=$rm->attachment?> + </a> + <?php } ?> + </div> + </div> + <?php } else { ?> + <?=\datalsts\objHeadCircle($rm->getAuthor(), 25)?> + <?=$rm->renderMesg()?> + <small><?=$rm->created?></small> + <?php } ?> + </div> + </div> + <?php } ?> + + <form method="post" action="<?=ap()?>" enctype="multipart/form-data"> + <?=\formctrl\formname( "iss-mesg-add" )?> + <?=\formctrl\hidden( "issue", $i->guid )?> + <?=\formctrl\textarea( "New message", "mesg", 5 )?> + + <div class="btn-group pull-right"> + <button type="submit" name="input[postMesg]" class="btn btn-primary"> + <span class="glyphicon glyphicon-envelope"></span> Post message + </button> + + <button type="submit" name="input[closeIssue]" class="btn btn-success"> + <span class="glyphicon glyphicon-ok"></span> Close issue + </button> + </div> + + <?=\formctrl\file( "Attachment", "attachment" )?> + </form> + </div> + + <div class="col-md-4"> + <?php $closer = $i->getCloser(); ?> + <?php $assigns = $i->getAssignees(); ?> + <?php $owner = $i->getOwner(); ?> + <?php $author = $m->getAuthor(); ?> + <?php $members = $i->getMembers(); ?> + + <?php if ($closer) { ?> + <?=userPanel($closer, "alert alert-success", "closed", $i->closed)?> + <?php } ?> + + <?php if (count($assigns) == 0) { ?> + <?=userPanel(NULL, "alert alert-danger", "unassigned", "")?> + <?php } ?> + + <?php foreach ($assigns as $assign) { ?> + <?php if ($assign->signedoff != "") { ?> + <?=userPanel($assign->assignee, "alert alert-success", "signed off", $assign->signedoff)?> + <?php } else { ?> + <?=userPanel($assign->assignee, "alert alert-warning", "assigned", $assign->assigned)?> + <?php } ?> + <?php } ?> + + <?=userPanel($owner, "alert alert-info", "opened", $i->created)?> + + <?php if ($author->guid != $owner->guid) { ?> + <?=userPanel($author, "alert alert-info", "authored", $m->created)?> + <?php } ?> + + <?php if (count($members) != 0) { ?> + <hr /> + <?php } ?> + + <?php foreach ($members as $m) { ?> + <?=userPanel($m, "well", "cc'd", "")?> + <?php } ?> + </div> + </div> + </div> + </div> + </div> + </div> + +<?php } ?> diff --git a/app/view/login.php b/app/view/login.php new file mode 100644 index 0000000..901a12d --- /dev/null +++ b/app/view/login.php @@ -0,0 +1,117 @@ +<?php + +/* + * SCROTT 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 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. + * + * For more information, please refer to UNLICENSE + */ + +require_once "model/login.php"; +require_once "view/stdpage.php"; +require_once "view/formctrl.php"; + +?> + +<!DOCTYPE html> + +<html lang="en"> + <head> + <?=stdpage\head( "Not logged in" )?> + </head> + + <body> + <?=stdpage\top()?> + <?=stdpage\nav()?> + + <div class="container"> + <?php if (isset($noaccounts)) { ?> + <div class="jumbotron"> + <h1>Almost there...</h1> + <p class="text-center">Scrott's database is working, but no user accounts exist.<br /> + Use the form below to signup as an admin.</p> + <h5 class="text-center text-danger"> + It is presumed that you are the administrator for this Scrott install.<br /> + There is a security risk involved with exposing this page to the public! + </h5> + </div> + <?php } ?> + + <div class="tab-content"> + <div class="tab-pane fade <?=$activeTab['login']?>" id="loginTab"> + <div class="row"> + <div class="col-md-4"></div> + + <div class="col-md-4"> + <div class="panel panel-default"> + <div class="panel-body text-center"> + <form method="post" action="<?=ap()?>"> + <h1>Login</h1> + <?=formctrl\formname( "login" )?> + <?=formctrl\text( "Username", "uname" )?> + <?=formctrl\password( "Password", "passwd", false )?> + + <div class="btn-group pull-right"> + <?php if ($tabSwap) { ?> + <a href="#signupTab" class="btn btn-default" data-toggle="tab"> + Signup <span class="glyphicon glyphicon-user"></span> + </a> + <?php } ?> + + <button type="submit" class="btn btn-success"> + Login <span class="glyphicon glyphicon-log-in"></span> + </button> + </div> + </form> + </div> + </div> + </div> + + <div class="col-md-4"></div> + </div> + </div> + + <div class="tab-pane fade <?=$activeTab['signup']?>" id="signupTab"> + <div class="row"> + <div class="col-md-3"></div> + + <div class="col-md-6"> + <div class="panel panel-default"> + <div class="panel-body"> + <form method="post" action="<?=ap()?>"> + <h1 class="text-center">Signup for Scrott</h1> + <?=formctrl\formname( "signup" )?> + <?=formctrl\text( "Username", "uname" )?> + <?=formctrl\password( "Password", "passwd", false )?> + <?=formctrl\password( "Confirm Password", "cpasswd", false )?> + + <div class="btn-group pull-right"> + <?php if ($tabSwap) { ?> + <a href="#loginTab" class="btn btn-default" data-toggle="tab"> + Cancel <span class="glyphicon glyphicon-remove"></span> + </a> + <?php } ?> + + <button type="submit" class="btn btn-success"> + Signup <span class="glyphicon glyphicon-user"></span> + </button> + </div> + </form> + </div> + </div> + </div> + + <div class="col-md-3"></div> + </div> + </div> + </div> + </div> + + <?=stdpage\foot()?> + </body> +</html> diff --git a/app/view/pad.php b/app/view/pad.php new file mode 100644 index 0000000..a9c8508 --- /dev/null +++ b/app/view/pad.php @@ -0,0 +1,60 @@ +<?php + +/* + * SCROTT 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 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. + * + * For more information, please refer to UNLICENSE + */ + +require_once "model/pad.php"; +require_once "view/stdpage.php"; +require_once "view/datalsts.php"; +require_once "view/issue.php"; + +?> + +<!DOCTYPE html> + +<html lang="en"> + <head> + <?=stdpage\head( getPageName() )?> + </head> + + <body> + <?php foreach ($issues as $i) { ?> + <?=issue_v\issue($i)?> + <?php } ?> + + <?=stdpage\top()?> + <?=stdpage\nav()?> + + <div class="container"> + <div class="well well-lg"> + <div class="row"> + <div class="col-md-12"> + <h1> + <span class="glyphicon glyphicon-edit"></span> + <?=$pad->name?> + + <button type="button" class="btn btn-success" data-toggle="modal" data-target="#newIssueModal"> + <span class="glyphicon glyphicon-plus"></span> Open Issue + </button> + </h1> + </div> + </div> + </div> + + <?php foreach ($stages as $s) { ?> + <?=datalsts\stageListItem($s)?> + <?php } ?> + </div> + + <?=stdpage\foot()?> + </body> +</html> diff --git a/app/view/pads.php b/app/view/pads.php new file mode 100644 index 0000000..1f321d0 --- /dev/null +++ b/app/view/pads.php @@ -0,0 +1,55 @@ +<?php + +/* + * SCROTT 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 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. + * + * For more information, please refer to UNLICENSE + */ + +require_once "view/stdpage.php"; +require_once "view/datalsts.php"; + +?> + +<!DOCTYPE html> + +<html lang="en"> + <head> + <?=stdpage\head( "My Pads" )?> + </head> + + <body> + <?=stdpage\top()?> + <?=stdpage\nav()?> + + <div class="container"> + <div class="page-header"> + <h1> + My Pads + + <button type="button" class="btn btn-success pull-right" data-toggle="modal" data-target="#newPadModal"> + <span class="glyphicon glyphicon-plus"></span> Create new + </button> + </h1> + </div> + + <?php if (!count(user::getCurrent()->getPads_ordByOwnByName())) { ?> + <div class="jumbotron"> + <h2 class="text-center">You don't have any pads</h2> + </div> + <?php } ?> + + <?php foreach (user::getCurrent()->getPads_ordByOwnByName() as $p) { ?> + <?=datalsts\gpListItem($p)?> + <?php } ?> + </div> + + <?=stdpage\foot()?> + </body> +</html> diff --git a/app/view/settings.php b/app/view/settings.php new file mode 100644 index 0000000..21b75ba --- /dev/null +++ b/app/view/settings.php @@ -0,0 +1,219 @@ +<?php + +/* + * SCROTT 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 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. + * + * For more information, please refer to UNLICENSE + */ + +namespace settings; + +require_once "model/settings.php"; +require_once "view/formctrl.php"; +require_once "view/datalsts.php"; +require_once "class/settings.class.php"; +require_once "class/obj.class.php"; +require_once "class/user.class.php"; + +?> +<?php function settings() : void { ?> + + <div id="settingsModal" class="modal fade" tabindex="-1" role="dialog"> + <div class="modal-dialog" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal"> + <span aria-hidden="true">×</span> + </button> + + <h4 class="modal-title"> + <span class="glyphicon glyphicon-cog"></span> Settings + </h4> + </div> + + <div class="modal-body"> + <?php $s = false; ?> + <?php $u = \user::getCurrent(); ?> + + <ul class="nav nav-tabs" role="tablist"> + <li class="<?=oneStr("active", $s)?>"> + <a href="#settingsUserTab" data-toggle="tab"> + <span class="glyphicon glyphicon-user"></span> <?=$u->getDisplayName()?> + </a> + </li> + + <?php if ($u->admin == 1) { ?> + <li class="<?=oneStr("active", $s)?>"> + <a href="#settingsAdminTab" data-toggle="tab"> + <span class="glyphicon glyphicon-sunglasses"></span> Admin + </a> + </li> + <?php } ?> + </ul> + + <?php $s = false; ?> + + <div class="tab-content"> + <div class="tab-pane fade <?=oneStr("in active", $s)?>" id="settingsUserTab"> + <?=userTab($u)?> + </div> + + <?php if ($u->admin == 1) { ?> + <div class="tab-pane fade <?=oneStr("in active", $s)?>" id="settingsAdminTab"> + <?=adminTab()?> + </div> + <?php } ?> + </div> + </div> + </div> + </div> + </div> + +<?php } ?> +<?php function image(\obj $obj, string $type, string $label) : void { ?> + + <div class="col-md-6 text-center"> + <?php if ($type == "head") { ?> + <?=\datalsts\objHeadCircle($obj, 100)?> + <?php $d = (!$obj->hasHeadImg() ? "disabled" : ""); ?> + <?php } else { ?> + <?=\datalsts\objBgPrev($obj, 100)?> + <?php $d = (!$obj->getBgImg() ? "disabled" : ""); ?> + <?php } ?> + + <br /> + <br /> + + <button type="button" class="btn btn-default btn-xs" data-toggle="collapse" data-target="#setimgCollapse-<?=$obj->guid?>-<?=$type?>"> + <span class="glyphicon glyphicon-camera"></span> Upload new image + </button> + + <br /> + + <button type="submit" name="input[rmImg-<?=$type?>]" class="btn btn-danger btn-xs" <?=$d?> onclick="return assertconfirm()"> + <span class="glyphicon glyphicon-remove"></span> Remove image + </button> + + <br /> + <br /> + + <div class="collapse" id="setimgCollapse-<?=$obj->guid?>-<?=$type?>"> + <?=\formctrl\file($label, "img-".$type)?> + </div> + </div> + +<?php } ?> +<?php function userTab(\user $u) : void { ?> + + <form method="post" action="<?=ap()?>" enctype="multipart/form-data"> + <?=\formctrl\formname( "settings-user" )?> + <?=\formctrl\hidden( "guid", $u->guid )?> + + <p> </p> + + <div class="row"> + <?=image($u, "head", "User Image")?> + <?=image($u, "bg", "Background Image")?> + </div> + + <p> </p> + + <?php if ($u->admin == 1) { ?> + <p class="pull-right"> + <span class="glyphicon glyphicon-sunglasses"></span> <?=$u->getDisplayName()?> is a Scrott Administrator + </p> + <?php } ?> + + <?=\formctrl\text( "Username", "", $u->name, "", false, true )?> + <?=\formctrl\checkbox( "Change Password", "setpasswd", false, false, "#setpasswdCollapse-".$u->guid )?> + + <div class="collapse" id="setpasswdCollapse-<?=$u->guid?>"> + <?=\formctrl\password( "Current Password", "curpasswd", false )?> + <?=\formctrl\password( "New Password", "passwd", false )?> + <?=\formctrl\password( "Confirm Password", "cpasswd", false )?> + </div> + + <?=\formctrl\text( "Alias", "alias", $u->alias, "", false )?> + <?=\formctrl\text( "Email", "email", $u->email, "", false, false, ($u->emailConf == 1 ? "has-success" : "") )?> + + <?php if ($u->email != "" && $u->emailConf == 0) { ?> + <?=\formctrl\text( "Email Verification Key", "emailVer", "", "", false, false, "has-warning", "You have not confirmed ownership of your email address" )?> + <?php } ?> + + <div class="btn-group pull-right"> + <button type="submit" class="btn btn-success"> + <span class="glyphicon glyphicon-ok"></span> Save Changes + </button> + + <a href="<?=ar()?>/deleteaccount" class="btn btn-danger"> + <span class="glyphicon glyphicon-trash"></span> Delete Account + </a> + </div> + + <h6>Created <?=$u->created?></h6> + <h6>Updated <?=$u->updated?></h6> + </form> + +<?php } ?> +<?php function adminTab() : void { ?> + + <form method="post" action="<?=ap()?>"> + <?=\formctrl\formname( "settings-admin" )?> + + <p> </p> + + <div class="well well-sm"> + See detailed statistics, manage users and other objects in the <a href="<?=ar()?>/admin">Administration Panel</a> + </div> + + <legend><h4>General Settings</h4></legend> + <?=\formctrl\checkbox( "Require SSL", "sslOnly", \settings::sslOnly() )?> + <?=\formctrl\checkbox( "Allow anyone to create an account", "allowPublicSignup", \settings::allowPublicSignup() )?> + + <p> </p> + + <legend><h4>SMTP Settings</h4></legend> + + <?php $res = \settings::smtpResult(); ?> + + <?php if ($res == "true") { ?> + <p class="text-success pull-right">Last mail attempt was successful</p> + <?php } else if ($res == "false") { ?> + <p class="text-danger pull-right">Last mail attempt failed</p> + <?php } else { ?> + <p class="text-warning pull-right">No mail has been attempted yet</p> + <?php } ?> + + <?=\formctrl\text( "From Address", "smtpEmailAddress", \settings::smtpEmailAddress(), "", false )?> + <?=\formctrl\text( "From Name", "smtpFrom", \settings::smtpFrom(), "", false )?> + <?=\formctrl\text( "SMTP Server", "smtpServer", \settings::smtpServer(), "", false )?> + <?=\formctrl\text( "Server Port", "smtpPort", \settings::smtpPort() )?> + + <div class="form-group"> + <label>SMTP Security</label> + + <?php $sec = \settings::smtpSecurity(); ?> + <select name="input[smtpSecurity]" class="form-control selectpicker"> + <option value="" <?=($sec == "" ? "selected" : "")?>>None</option> + <option value="ssl" <?=($sec == "ssl" ? "selected" : "")?>>SSL</option> + <option value="tls" <?=($sec == "tls" ? "selected" : "")?>>TLS</option> + </select> + </div> + + <?=\formctrl\text( "Username", "smtpUname", \settings::smtpUname(), "", false )?> + <?=\formctrl\password( "Password", "smtpPasswd", false )?> + + <button type="submit" class="btn btn-success pull-right"> + <span class="glyphicon glyphicon-ok"></span> Save Changes + </button> + + <p> </p> + </form> + +<?php } ?> diff --git a/app/view/stdpage.php b/app/view/stdpage.php new file mode 100644 index 0000000..99cbb25 --- /dev/null +++ b/app/view/stdpage.php @@ -0,0 +1,266 @@ +<?php + +/* + * SCROTT 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 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. + * + * For more information, please refer to UNLICENSE + */ + +namespace stdpage; + +require_once "class/globals.php"; +require_once "class/user.class.php"; +require_once "view/datamods.php"; +require_once "view/settings.php"; + +?> +<?php function head(?string $title = NULL) : void { ?> + + <!-- + + ███████╗ ██████╗██████╗ ██████╗ ████████╗████████╗ + ██╔════╝██╔════╝██╔══██╗██╔═══██╗╚══██╔══╝╚══██╔══╝ + ███████╗██║ ██████╔╝██║ ██║ ██║ ██║ + ╚════██║██║ ██╔══██╗██║ ██║ ██║ ██║ + ███████║╚██████╗██║ ██║╚██████╔╝ ██║ ██║ + ╚══════╝ ╚═════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ + Secure Centralized Robust Online Ticketing Tool + <?=__VERSION__?> + + + * This is free and unencumbered software released into the public domain. + * + * Anyone is free to copy, modify, publish, use, compile, sell, or + * distribute this software, either in source code form or as a compiled + * binary, for any purpose, commercial or non-commercial, and by any + * means. + * + * In jurisdictions that recognize copyright laws, the author or authors + * of this software dedicate any and all copyright interest in the + * software to the public domain. We make this dedication for the benefit + * of the public at large and to the detriment of our heirs and + * successors. We intend this dedication to be an overt act of + * relinquishment in perpetuity of all present and future rights to this + * software under copyright law. + * + * 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 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. + * + * For more information, please refer to <http://unlicense.org/> + --> + + <meta charset="utf-8" /> + <meta http-equiv="X-UA-Compatible" content="IE=edge" /> + <meta name="viewport" content="width=device-width, initial-scale=1" /> + + <title>Scrott<?=($title ? " - ".$title : "")?></title> + + <link rel="stylesheet" type="text/css" href="<?=ar()?>/static/css/bootstrap.min.css" /> + <link rel="stylesheet" type="text/css" href="<?=ar()?>/static/css/bootstrap-select.min.css" /> + + <style type="text/css"> + body + { + padding-top: 70px; + + <?php if (getPageObj() && ($pagebg = getPageObj()->getBgImg())) { ?> + background: url(<?=$pagebg?>) no-repeat center center fixed; + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + background-size: cover; + <?php } ?> + } + </style> + +<?php } ?> +<?php function top() : void { ?> + + <?php require "model/noticemodal.php"; ?> + + <?php if (isError(ERROR) || isError(WARNING) || isError(NOTICE)) { ?> + <div id="noticeModal" class="modal fade" tabindex="-1" role="dialog"> + <div class="modal-dialog" role="document"> + <div class="modal-content"> + <div class="modal-body alert <?=$noticeModalAlertClass?>" style="margin: 0;"> + <h1 class="text-center"><span class="glyphicon <?=$noticeModalGlyphicon?>"></span></h1> + <h5 class="text-center">Something Happened</h5> + + <?php if (isError(ERROR)) { ?> + <p> + <?php foreach (getErrors(ERROR) as $err) { ?> + <span class="label label-danger">Error</span> <?=$err?><br /> + <?php } ?> + </p> + <?php } ?> + + <?php if (isError(WARNING)) { ?> + <p> + <?php foreach (getErrors(WARNING) as $err) { ?> + <span class="label label-warning">Warning</span> <?=$err?><br /> + <?php } ?> + </p> + <?php } ?> + + <?php if (isError(NOTICE)) { ?> + <p> + <?php foreach (getErrors(NOTICE) as $err) { ?> + <span class="label label-info">Notice</span> <?=$err?><br /> + <?php } ?> + </p> + <?php } ?> + + <div class="text-center"> + <button type="button" class="btn btn-default" data-dismiss="modal"> + <span class="glyphicon glyphicon-ok"></span> Got it + </button> + </div> + </div> + </div> + </div> + </div> + <?php } ?> + +<?php } ?> +<?php function foot() : void { ?> + + <script type="text/javascript" src="<?=ar()?>/static/js/jquery.min.js"></script> + <script type="text/javascript" src="<?=ar()?>/static/js/bootstrap.min.js"></script> + <script type="text/javascript" src="<?=ar()?>/static/js/bootstrap-select.min.js"></script> + + <?php if (isError(ERROR) || isError(WARNING) || isError(NOTICE)) { ?> + <script type="text/javascript"> + $(window).on('load', function () { + $("#noticeModal").modal("show"); + }); + </script> + <?php } ?> + + <script type="text/javascript"> + $(".issueListItem").click(function () { + $("#issueModal-"+$(this).data("guid")).modal("show"); + }); + + function assertconfirm() { + return confirm("Are you sure?"); + } + </script> + +<?php } ?> +<?php function about() : void { ?> + + <div id="aboutModal" class="modal fade" tabindex="-1" role="dialog"> + <div class="modal-dialog" role="document"> + <div class="modal-content"> + <div class="modal-body" style="margin: 0;"> + <h1 class="text-center"><span class="glyphicon glyphicon-pencil"></span> Scrott</h1> + <h3 class="text-center"><span class="label label-primary"><?=__VERSION__?></span></h3> + </div> + </div> + </div> + </div> + +<?php } ?> +<?php function nav() : void { ?> + + <?=about()?> + + <?php if (\user::getCurrent()) { ?> + <?=\settings\settings()?> + <?=\datamods\newGroup()?> + <?=\datamods\newPad()?> + + <?php if (getPageObj()->objtype == "pad") { ?> + <?=\datamods\newIssue()?> + <?php } ?> + <?php } ?> + + <nav class="navbar navbar-inverse navbar-fixed-top"> + <div class="container-fluid"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#scrottnav" aria-expanded="false"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + + <a href="<?=ar()?>/" class="navbar-brand"> + <span class="glyphicon glyphicon-pencil"></span> Scrott + </a> + </div> + + <div class="collapse navbar-collapse" id="scrottnav"> + <?php if (!\user::getCurrent()) { ?> + <p class="navbar-text navbar-right"><i>Not Logged In </i></p> + <?php } else { ?> + <ul class="nav navbar-nav"> + <li><a href="<?=ap()?>"><span class="glyphicon glyphicon-refresh"></span></a></li> + <li><a href="<?=ar()?>/groups"><span class="glyphicon glyphicon-th"></span></a></li> + <li><a href="<?=ar()?>/pads"><span class="glyphicon glyphicon-edit"></span></a></li> + + <li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> + <?=getPageName()?> <span class="caret"></span> + </a> + + <ul class="dropdown-menu"> + <li><a href="#">TODO</a></li> + <li><a href="#">TODO</a></li> + <li><a href="#">TODO</a></li> + </ul> + </li> + + <li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> + <span class="glyphicon glyphicon-plus"></span> <span class="caret"></span> + </a> + + <ul class="dropdown-menu"> + <li><a href="#" data-toggle="modal" data-target="#newGroupModal">New Group</a></li> + <li><a href="#" data-toggle="modal" data-target="#newPadModal">New Pad</a></li> + + <?php if (getPageObj()->objtype == "pad") { ?> + <li class="divider"></li> + <li><a href="#" data-toggle="modal" data-target="#newIssueModal">New Issue</a></li> + <?php } ?> + </ul> + </li> + </ul> + + <ul class="nav navbar-nav navbar-right"> + <li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> + <?php if (\user::getCurrent()->admin == 1) { ?> + <span class="glyphicon glyphicon-sunglasses"></span> + <?php } ?> + + <span class="glyphicon glyphicon-user"></span> + + <?=\user::getCurrent()->getDisplayName()?> + <span class="caret"></span> + </a> + + <ul class="dropdown-menu"> + <li><a href="#" data-toggle="modal" data-target="#aboutModal">About Scrott</a></li> + <li><a href="#" data-toggle="modal" data-target="#settingsModal">Settings</a></li> + <li><a href="<?=ar()?>/logout">Log out</a></li> + </ul> + </li> + </ul> + <?php } ?> + </div> + </div> + </nav> + +<?php } ?> |