OSB enhancements to date
This commit is contained in:
@@ -1,27 +1,34 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* AgileBill - Open Billing Software
|
||||
*
|
||||
* This body of work is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the Open AgileBill License
|
||||
* License as published at http://www.agileco.com/agilebill/license1-4.txt
|
||||
*
|
||||
* For questions, help, comments, discussion, etc., please join the
|
||||
* Agileco community forums at http://forum.agileco.com/
|
||||
*
|
||||
* Originally authored by Tony Landis, AgileBill LLC
|
||||
*
|
||||
* Recent modifications by Deon George
|
||||
*
|
||||
* @author Deon George <deonATleenooksDOTnet>
|
||||
* @copyright 2009 Deon George
|
||||
* @link http://osb.leenooks.net
|
||||
*
|
||||
* @link http://www.agileco.com/
|
||||
* @copyright 2004-2008 Agileco, LLC.
|
||||
* @license http://www.agileco.com/agilebill/license1-4.txt
|
||||
* @author Tony Landis <tony@agileco.com>
|
||||
* @author Tony Landis <tony@agileco.com>
|
||||
* @package AgileBill
|
||||
* @version 1.4.93
|
||||
* @subpackage Module:Asset
|
||||
*/
|
||||
|
||||
class asset
|
||||
{
|
||||
var $module = "asset";
|
||||
|
||||
|
||||
/**
|
||||
* The main AgileBill Asset Class
|
||||
*
|
||||
* @package AgileBill
|
||||
* @subpackage Module:Asset
|
||||
*/
|
||||
class asset extends OSB_module {
|
||||
/* check availibility */
|
||||
function available($assetPoolId, $qty=1) {
|
||||
$db=&DB();
|
||||
@@ -110,73 +117,5 @@ class asset
|
||||
$C_debug->alert('Unable to process the uploaded file.');
|
||||
}
|
||||
}
|
||||
|
||||
function construct() {
|
||||
$this->xml_construct = PATH_MODULES . $this->module . "/" . $this->module . "_construct.xml";
|
||||
$C_xml = new CORE_xml;
|
||||
$construct = $C_xml->xml_to_array($this->xml_construct);
|
||||
$this->method = $construct["construct"]["method"];
|
||||
$this->trigger = $construct["construct"]["trigger"];
|
||||
$this->field = $construct["construct"]["field"];
|
||||
$this->table = $construct["construct"]["table"];
|
||||
$this->module = $construct["construct"]["module"];
|
||||
$this->cache = $construct["construct"]["cache"];
|
||||
$this->order_by = $construct["construct"]["order_by"];
|
||||
$this->limit = $construct["construct"]["limit"];
|
||||
}
|
||||
|
||||
function add($VAR) {
|
||||
$this->construct();
|
||||
$type = "add";
|
||||
$this->method["$type"] = explode(",", $this->method["$type"]);
|
||||
$db = new CORE_database;
|
||||
$db->add($VAR, $this, $type);
|
||||
}
|
||||
|
||||
function view($VAR) {
|
||||
$this->construct();
|
||||
$type = "view";
|
||||
$this->method["$type"] = explode(",", $this->method["$type"]);
|
||||
$db = new CORE_database;
|
||||
$db->view($VAR, $this, $type);
|
||||
}
|
||||
|
||||
function update($VAR) {
|
||||
$this->construct();
|
||||
$type = "update";
|
||||
$this->method["$type"] = explode(",", $this->method["$type"]);
|
||||
$db = new CORE_database;
|
||||
$db->update($VAR, $this, $type);
|
||||
}
|
||||
|
||||
function delete($VAR) {
|
||||
$this->construct();
|
||||
$db = new CORE_database;
|
||||
$db->mass_delete($VAR, $this, "");
|
||||
}
|
||||
|
||||
function search_form($VAR) {
|
||||
$this->construct();
|
||||
$type = "search";
|
||||
$this->method["$type"] = explode(",", $this->method["$type"]);
|
||||
$db = new CORE_database;
|
||||
$db->search_form($VAR, $this, $type);
|
||||
}
|
||||
|
||||
function search($VAR) {
|
||||
$this->construct();
|
||||
$type = "search";
|
||||
$this->method["$type"] = explode(",", $this->method["$type"]);
|
||||
$db = new CORE_database;
|
||||
$db->search($VAR, $this, $type);
|
||||
}
|
||||
|
||||
function search_show($VAR) {
|
||||
$this->construct();
|
||||
$type = "search";
|
||||
$this->method["$type"] = explode(",", $this->method["$type"]);
|
||||
$db = new CORE_database;
|
||||
$db->search_show($VAR, $this, $type);
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
@@ -1,64 +1,121 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<construct>
|
||||
<module>asset</module>
|
||||
<table>asset</table>
|
||||
<dependancy></dependancy>
|
||||
<cache>0</cache>
|
||||
<order_by>asset</order_by>
|
||||
<limit>35</limit>
|
||||
|
||||
<field>
|
||||
<id>
|
||||
<type>I8</type>
|
||||
<unique>1</unique>
|
||||
</id>
|
||||
<site_id>
|
||||
<type>I4</type>
|
||||
</site_id>
|
||||
<date_orig>
|
||||
<type>I8</type>
|
||||
<convert>date-now</convert>
|
||||
</date_orig>
|
||||
<date_last>
|
||||
<type>I8</type>
|
||||
<convert>date-now</convert>
|
||||
</date_last>
|
||||
<status>
|
||||
<type>L</type>
|
||||
</status>
|
||||
<service_id>
|
||||
<type>I8</type>
|
||||
</service_id>
|
||||
<pool_id>
|
||||
<type>I4</type>
|
||||
<asso_table>asset_pool</asso_table>
|
||||
<asso_field>name</asso_field>
|
||||
<validate>any</validate>
|
||||
</pool_id>
|
||||
<asset>
|
||||
<type>C(128)</type>
|
||||
<min_len>1</min_len>
|
||||
<max_len>128</max_len>
|
||||
</asset>
|
||||
<misc>
|
||||
<type>C(255)</type>
|
||||
</misc>
|
||||
</field>
|
||||
|
||||
<method>
|
||||
<add>id,site_id,date_orig,date_last,status,service_id,pool_id,asset,misc</add>
|
||||
<update>id,site_id,date_last,status,service_id,pool_id,asset,misc</update>
|
||||
<delete>id,site_id,date_orig,date_last,status,service_id,pool_id,asset,misc</delete>
|
||||
<view>id,site_id,date_orig,date_last,status,service_id,pool_id,asset,misc</view>
|
||||
<search>id,site_id,date_orig,date_last,status,service_id,pool_id,asset,misc</search>
|
||||
</method>
|
||||
|
||||
<index>
|
||||
<assets>id,site_id</assets>
|
||||
<asso>pool_id</asso>
|
||||
<service>service_id</service>
|
||||
<asset>asset</asset>
|
||||
</index>
|
||||
|
||||
<trigger>0</trigger>
|
||||
</construct>
|
||||
<!-- Module name -->
|
||||
<module>asset</module>
|
||||
<!-- Module supporting database table -->
|
||||
<table>asset</table>
|
||||
<!-- Module dependancy(s) (module wont install if these modules are not yet installed) -->
|
||||
<dependancy></dependancy>
|
||||
<!-- DB cache in seconds -->
|
||||
<cache>0</cache>
|
||||
<!-- Default order_by field for SQL queries -->
|
||||
<order_by>asset</order_by>
|
||||
<!-- Default SQL limit for SQL queries -->
|
||||
<limit>25</limit>
|
||||
<!-- Schema version (used to determine if the schema has change during upgrades) -->
|
||||
<version>0</version>
|
||||
|
||||
<!-- Database indexes -->
|
||||
<index>
|
||||
<assets>id,site_id</assets>
|
||||
<asso>pool_id</asso>
|
||||
<service>service_id</service>
|
||||
<asset>asset</asset>
|
||||
</index>
|
||||
|
||||
<!-- Database fields -->
|
||||
<field>
|
||||
<!-- Record ID -->
|
||||
<id>
|
||||
<index>1</index>
|
||||
<type>I8</type>
|
||||
<unique>1</unique>
|
||||
</id>
|
||||
<!-- Site ID -->
|
||||
<site_id>
|
||||
<index>1</index>
|
||||
<type>I4</type>
|
||||
</site_id>
|
||||
<!-- Date record created -->
|
||||
<date_orig>
|
||||
<convert>date-now</convert>
|
||||
<display>Date Created</display>
|
||||
<type>I8</type>
|
||||
</date_orig>
|
||||
<!-- Date record updated -->
|
||||
<date_last>
|
||||
<convert>date-now</convert>
|
||||
<display>Date Updated</display>
|
||||
<type>I8</type>
|
||||
</date_last>
|
||||
<!-- Record active (BOOL)-->
|
||||
<status>
|
||||
<display>Active</display>
|
||||
<type>L</type>
|
||||
</status>
|
||||
<service_id>
|
||||
<display>Service ID</display>
|
||||
<type>I8</type>
|
||||
</service_id>
|
||||
<pool_id>
|
||||
<display>Pool</display>
|
||||
<asso_table>asset_pool</asso_table>
|
||||
<asso_field>name</asso_field>
|
||||
<type>I4</type>
|
||||
<validate>any</validate>
|
||||
</pool_id>
|
||||
<asset>
|
||||
<display>Asset</display>
|
||||
<min_len>1</min_len>
|
||||
<max_len>128</max_len>
|
||||
<type>C(128)</type>
|
||||
</asset>
|
||||
<misc>
|
||||
<display>Notes</display>
|
||||
<type>C(255)</type>
|
||||
</misc>
|
||||
</field>
|
||||
|
||||
<!-- Methods for this class, and the fields they have access to, if applicable -->
|
||||
<method>
|
||||
<add>status,pool_id,asset,misc</add>
|
||||
<update>id,status,service_id,pool_id,asset,misc</update>
|
||||
<delete>id</delete>
|
||||
<view>id,date_orig,date_last,status,service_id,pool_id,asset,misc</view>
|
||||
<search>id,date_orig,date_last,status,service_id,pool_id,asset,misc</search>
|
||||
</method>
|
||||
|
||||
<!-- Method triggers -->
|
||||
<trigger></trigger>
|
||||
|
||||
<!-- Template page display titles -->
|
||||
<title>
|
||||
<add>Add Asset</add>
|
||||
<view>View Asset</view>
|
||||
</title>
|
||||
|
||||
<!-- Template helpers -->
|
||||
<tpl>
|
||||
<search_show>
|
||||
<checkbox>
|
||||
<field>id</field>
|
||||
<type>checkbox</type>
|
||||
<width>25px</width>
|
||||
</checkbox>
|
||||
<date_last>
|
||||
<field>date_last</field>
|
||||
<type>date</type>
|
||||
</date_last>
|
||||
<status>
|
||||
<field>status</field>
|
||||
<type>bool_icon</type>
|
||||
</status>
|
||||
<pool_id>
|
||||
<field>pool_id</field>
|
||||
</pool_id>
|
||||
<asset>
|
||||
<field>asset</field>
|
||||
</asset>
|
||||
</search_show>
|
||||
</tpl>
|
||||
</construct>
|
||||
|
@@ -1,47 +1,64 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<install>
|
||||
<module_properties>
|
||||
<name>asset</name>
|
||||
<parent>asset</parent>
|
||||
<notes>Manage assets that can be assigned to services and maintain their availibility status</notes>
|
||||
<menu_display>1</menu_display>
|
||||
<dependancy></dependancy>
|
||||
<sub_modules>asset_pool</sub_modules>
|
||||
</module_properties>
|
||||
<sql_inserts>
|
||||
<module_method>
|
||||
<add>
|
||||
<name>add</name>
|
||||
<page>%%:add</page>
|
||||
<menu_display>1</menu_display>
|
||||
</add>
|
||||
<update>
|
||||
<name>update</name>
|
||||
</update>
|
||||
<delete>
|
||||
<name>delete</name>
|
||||
</delete>
|
||||
<view>
|
||||
<name>view</name>
|
||||
<page>core:search&module=%%&_escape=1</page>
|
||||
<menu_display>1</menu_display>
|
||||
</view>
|
||||
<search>
|
||||
<name>search</name>
|
||||
<page>%%:search_form</page>
|
||||
<menu_display>1</menu_display>
|
||||
</search>
|
||||
<search_form>
|
||||
<name>search_form</name>
|
||||
</search_form>
|
||||
<search_show>
|
||||
<name>search_show</name>
|
||||
</search_show>
|
||||
<import>
|
||||
<name>import</name>
|
||||
<page>%%:import</page>
|
||||
<menu_display>1</menu_display>
|
||||
</import>
|
||||
</module_method>
|
||||
</sql_inserts>
|
||||
</install>
|
||||
<install>
|
||||
<!-- Tree Menu Module Properties -->
|
||||
<module_properties>
|
||||
<!-- MODULE Dependancy, this module wont be installed if the dependant modules dont exist -->
|
||||
<dependancy></dependancy>
|
||||
<!-- Translated display to use on the tree -->
|
||||
<display>Asset</display>
|
||||
<!-- Display a module in the menu tree -->
|
||||
<menu_display>1</menu_display>
|
||||
<!-- MODULE Name -->
|
||||
<name>asset</name>
|
||||
<!-- MODULE Notes, these notes show up in the modules table, as a description of the module -->
|
||||
<notes><![CDATA[Manage assets that can be assigned to services and maintain their availibility status.]]></notes>
|
||||
<!-- MODULE Parent, the parent node in the tree -->
|
||||
<parent></parent>
|
||||
<!-- SUB Modules to install with this one -->
|
||||
<sub_modules>asset_pool</sub_modules>
|
||||
<!-- MODULE Type (core|base), core modules cannot be deleted, unrecognised types are ignored. -->
|
||||
<type></type>
|
||||
</module_properties>
|
||||
|
||||
<!-- Tree Menu & Module Methods to load, they will be assigned the group permissions on install time, as selected by the user. -->
|
||||
<module_method>
|
||||
<add>
|
||||
<display>Add</display>
|
||||
<menu_display>1</menu_display>
|
||||
<name>add</name>
|
||||
<notes><![CDATA[Add records]]></notes>
|
||||
</add>
|
||||
<delete>
|
||||
<name>delete</name>
|
||||
<notes><![CDATA[Delete records]]></notes>
|
||||
</delete>
|
||||
<search>
|
||||
<display>List</display>
|
||||
<name>search</name>
|
||||
<menu_display>1</menu_display>
|
||||
<notes><![CDATA[List records]]></notes>
|
||||
<page><![CDATA[core:search&module=%%&_next_page_one=view]]></page>
|
||||
</search>
|
||||
<search_form>
|
||||
<name>search_form</name>
|
||||
<notes><![CDATA[Search for records]]></notes>
|
||||
</search_form>
|
||||
<search_show>
|
||||
<name>search_show</name>
|
||||
<notes><![CDATA[Show the results of a search]]></notes>
|
||||
</search_show>
|
||||
<update>
|
||||
<name>update</name>
|
||||
<notes><![CDATA[Update a record]]></notes>
|
||||
</update>
|
||||
<view>
|
||||
<name>view</name>
|
||||
<notes><![CDATA[View a record]]></notes>
|
||||
</view>
|
||||
<import>
|
||||
<display>Import</display>
|
||||
<menu_display>1</menu_display>
|
||||
<name>import</name>
|
||||
</import>
|
||||
</module_method>
|
||||
</install>
|
||||
|
Reference in New Issue
Block a user