From: <dai...@us...> - 2015-08-16 05:25:45
|
Revision: 7342 http://sourceforge.net/p/web-erp/reponame/7342 Author: daintree Date: 2015-08-16 05:25:43 +0000 (Sun, 16 Aug 2015) Log Message: ----------- dev manual improvements Modified Paths: -------------- trunk/doc/Manual/ManualDevelopmentStructure.html trunk/doc/Manual/ManualNewScripts.html Modified: trunk/doc/Manual/ManualDevelopmentStructure.html =================================================================== --- trunk/doc/Manual/ManualDevelopmentStructure.html 2015-08-16 05:08:07 UTC (rev 7341) +++ trunk/doc/Manual/ManualDevelopmentStructure.html 2015-08-16 05:25:43 UTC (rev 7342) @@ -1,6 +1,6 @@ <h1><a id="DevelopmentStructure">Development - Structure</a></h1> -<p>This page will be of interest primarily to developers wishing to get to grips with the system and how the various scripts function.</p> +<p>This page will be of interest primarily to developers wishing to get to grips with the system and how the various scripts function. It is very old and possibly outdated in places.</p> <h2>Sales Orders</h2> Modified: trunk/doc/Manual/ManualNewScripts.html =================================================================== --- trunk/doc/Manual/ManualNewScripts.html 2015-08-16 05:08:07 UTC (rev 7341) +++ trunk/doc/Manual/ManualNewScripts.html 2015-08-16 05:25:43 UTC (rev 7342) @@ -44,7 +44,7 @@ <h3>session.inc</h3> -<p>This page must be included after the page has set the variable $PageSecurity to an appropriate integer (see the security schema section), session.inc has the following functons:</p> +<p>This page must be included and has the following functons:</p> <ul> <li>Establishes a session if none already exists and checks that an authorised user is logged in - if so it checks that the user is authorised for the specific page being called, based on the value of $PageSecurity.</li> @@ -94,6 +94,65 @@ <p>Having started the page with session.inc and header.inc - and then finishing with footer.inc much of the work to ensure a consistent look and feel is already done.</p> +<h3>An Example webERP Script Template</h3> +<p>Following from the discussion of the key component scripts of webERP, the general form of a webERP script would look like the following:</p> +<pre> +<?php + +/* session.inc is the script that brings in session + * management, database management, and performs + * any other housekeeping tasks related to the running + * of webERP. and so should be included right at the + * top of every script. + */ +include('includes/session.inc'); + +/* A title for the script must be assigned prior to + * including the header.inc script + */ +$Title = _('Simple webERP Script'); + +/* The $ViewTopic variable should be set to the name + * of the manual page for this functionality and the + * $BookMark variable is the place in that manual page + * specifically for this functionality + */ +$ViewTopic = 'SimpleScript'; +$BookMark = 'GeneralTopics'; + +/* The header.inc file sends all the http headers needed, + * links in the style sheets and downloads any javascript + * files that are needed. It also draws the header on the + * screen. Muse be included before any output is sent to + * the browser. + */ +include('includes/header.inc'); + +if (!isset($_POST['Submit'])) { +/* In this section should go the code to validate the data + * submitted in the form, and if all is well it should + * post that data to the database. If there is more than + * one table to be updated that transactions should be used + * in order to maintain the database integrity. + * If the form does not validate then it processing can just + * fall through to the next section, but show any required + * messages. + */ +} + +/* This section is where any of the display code goes. + * Typically this will contain a table of the existing data, + * and a form for entry of new details. + */ + +/* Finally we must include footer.inc to draw the footer on + * the screen, display any error messages, and close off the + * html tags in the page. + */ +include('includes/footer.inc'); +?> +</pre> + <div class="floatright"> <a class="minitext" href="#top">⬆ Top</a> </div> |