http://www.freeside.biz/mediawiki/index.php?title=Freeside:4:Documentation:Developer/FS/UI/Web&feed=atom&action=historyFreeside:4:Documentation:Developer/FS/UI/Web - Revision history2024-03-29T00:12:15ZRevision history for this page on the wikiMediaWiki 1.27.7http://www.freeside.biz/mediawiki/index.php?title=Freeside:4:Documentation:Developer/FS/UI/Web&diff=9454&oldid=prevJeremyd: Edit via perl MediaWiki framework (1.13)2015-11-18T15:40:25Z<p>Edit via perl MediaWiki framework (1.13)</p>
<p><b>New page</b></p><div>; svc_url<br />
:Returns a service URL, first checking to see if there is a service-specific page to link to, otherwise to a generic service handling page. Options are passed as a list of name-value pairs, and include:<br />
** m - Mason request object ($m)<br />
** action - The action for which to construct "edit", "view", or "search"<br />
** ** part_svc - Service definition (see [[Freeside:4:Documentation:Developer/FS/part svc|FS::part_svc]])<br />
** ** svcdb - Service table<br />
** *** query - Query string<br />
** *** svc - FS::cust_svc or FS::svc_* object<br />
** ahref - Optional flag, if set true returns <A HREF="$url"> instead of just the URL.<br />
<br />
:* Required fields<br />
<br />
:** part_svc OR svcdb is required<br />
<br />
:*** query OR svc is required<br />
:; cust_header [ CUST_FIELDS_VALUE ]<br />
::Returns an array of customer information headers according to the supplied customer fields value, or if no value is supplied, the '''cust-fields''' configuration value.<br />
:; cust_sql_fields [ CUST_FIELDS_VALUE ]<br />
::Returns a list of fields for the SELECT portion of an SQL query.<br />
<br />
::As with [[#cust_header|the cust_header subroutine]], the fields returned are defined by the supplied customer fields setting, or if no customer fields setting is supplied, the <B>cust-fields</B> configuration value.<br />
:; join_cust_main [ TABLE[.CUSTNUM] ] [ LOCATION_TABLE[.LOCATIONNUM] ]<br />
::Returns an SQL join phrase for the FROM clause so that the fields listed in [[Freeside:4:Documentation:Developer/cust sql fields|cust_sql_fields]] will be available. Currently joins to cust_main itself, as well as cust_location (under the aliases 'bill_location' and 'ship_location') if address fields are needed. [[Freeside:4:Documentation:Developer/cust header()|cust_header()]] should have been called already.<br />
<br />
::All of these will be left joins; if you want to exclude rows with no linked cust_main record (or bill_location/ship_location), you can do so in the WHERE clause.<br />
<br />
::TABLE is the table containing the custnum field. If CUSTNUM (a field name in that table) is specified, that field will be joined to cust_main.custnum. Otherwise, this function will assume the field is named "custnum". If the argument isn't present at all, the join will just say "USING (custnum)", which might work.<br />
<br />
::As a special case, if TABLE is 'cust_main', only the joins to cust_location will be returned.<br />
<br />
::LOCATION_TABLE is an optional table name to use for joining ship_location, in case your query also includes package information and you want the "service address" columns to reflect package addresses.<br />
:; cust_fields OBJECT [ CUST_FIELDS_VALUE ]<br />
::Given an object that contains fields from cust_main (say, from a JOINed search. See httemplate/search/svc_* for examples), returns an array of customer information, or "(unlinked)" if this service is not linked to a customer.<br />
<br />
::As with [[#cust_header|the cust_header subroutine]], the fields returned are defined by the supplied customer fields setting, or if no customer fields setting is supplied, the <B>cust-fields</B> configuration value.<br />
:; cust_fields_subs<br />
::Returns an array of subroutine references for returning customer field values. This is similar to cust_fields, but returns each field's sub as a distinct element.<br />
:; cust_colors<br />
::Returns an array of subroutine references (or empty strings) for returning customer information colors.<br />
<br />
::As with [[#cust_header|the cust_header subroutine]], the fields returned are defined by the supplied customer fields setting, or if no customer fields setting is supplied, the <B>cust-fields</B> configuration value.<br />
:; cust_styles<br />
::Returns an array of customer information styles.<br />
<br />
::As with [[#cust_header|the cust_header subroutine]], the fields returned are defined by the supplied customer fields setting, or if no customer fields setting is supplied, the <B>cust-fields</B> configuration value.<br />
:; cust_aligns<br />
::Returns an array or scalar (depending on context) of customer information alignments.<br />
<br />
::As with [[#cust_header|the cust_header subroutine]], the fields returned are defined by the supplied customer fields setting, or if no customer fields setting is supplied, the <B>cust-fields</B> configuration value.<br />
:; cust_links<br />
::Returns an array of links to view/cust_main.cgi, for use with cust_fields.<br />
:; is_mobile<br />
::Utility function to determine if the client is a mobile browser.<br />
:; random_id [ DIGITS ]<br />
::Returns a random number of length DIGITS, or if unspecified, a long random identifier consisting of the timestamp, process ID, and a random number. Anything in the UI that needs a random identifier should use this.<br />
<br />
==POD ERRORS==<br />
Hey! '''The above document had some coding errors, which are explained below:'''<br />
<br />
; Around line 52&#58;<br />
:'=item' outside of any '=over'<br />
; Around line 64&#58;<br />
:Expected '=item *'<br />
; Around line 66&#58;<br />
:Expected '=item *'<br />
; Around line 68&#58;<br />
:Expected '=item *'<br />
; Around line 70&#58;<br />
:Expected '=item *'<br />
; Around line 72&#58;<br />
:Expected '=item *'</div>Jeremyd