diff --git a/distfiles/functions.php b/distfiles/functions.php index 24f2f7d..d737cc4 100644 --- a/distfiles/functions.php +++ b/distfiles/functions.php @@ -931,4 +931,54 @@ function format_message($msgtype,$msgtxt) { "; } +function templateselect($techid,$operation) { + // Displays a line enabling selection of a user or global template + // $techid is the id number of the current tech + // $operation is one of "add" "edit" "delete" + global $db; + echo " +
+ "; + // generate template selection line + echo " + + "; + // list user templates + echo " + + +
+  or  + "; + // list global templates + echo " +    + "; + // show load button + echo " + + + + Manage templates +
+
+
+ "; +} ?> diff --git a/distfiles/templates.php b/distfiles/templates.php index 192aee8..74a691c 100644 --- a/distfiles/templates.php +++ b/distfiles/templates.php @@ -24,9 +24,6 @@ $flags=$_POST['flags'] ?? []; $refstring=$_REQUEST['refstring'] ?? NULL; $submit=$_REQUEST['submit'] ?? NULL; $operation=$_REQUEST['operation'] ?? NULL; -//$add=$_REQUEST['add'] ?? NULL; -//$edit=$_REQUEST['edit'] ?? NULL; -//$delete=$_REQUEST['delete'] ?? NULL; $templateid=$_REQUEST['templateid'] ?? NULL; $templatename=$_REQUEST['templatename'] ?? NULL; $usertemplateid=$_REQUEST['usertemplateid'] ?? NULL; @@ -59,7 +56,7 @@ if ($isadmin) { $authorized=FALSE; } -var_dump($_REQUEST); +// var_dump($_REQUEST); function templatetable($db,$techid,$user) { // Show template table @@ -154,53 +151,6 @@ function templatetable($db,$techid,$user) { echo "
"; } -function templateselect($db,$techid,$operation) { - echo " -
- "; - // generate template selection line - echo " - - "; - // list user templates - echo " - - -
-  or  - "; - // list global templates - echo " -    - "; - // show load button - echo " - - - - Manage templates -
-
-
- "; -} - // ******** begin database manipulation ******** if ($usertemplateid) { @@ -422,10 +372,9 @@ if ($operation=="delete") { echo "
$optext template

"; - - + // show the template selection line - templateselect($db,$techid,$operation); + templateselect($techid,$operation); // start template entry section echo "