[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[4510] trunk/UI/Contact
- Subject: SF.net SVN: ledger-smb:[4510] trunk/UI/Contact
- From: ..hidden..
- Date: Mon, 19 Mar 2012 09:43:12 +0000
Revision: 4510
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4510&view=rev
Author: einhverfr
Date: 2012-03-19 09:43:12 +0000 (Mon, 19 Mar 2012)
Log Message:
-----------
More refactoring of Contact framework
Modified Paths:
--------------
trunk/UI/Contact/contact.html
trunk/UI/Contact/divs/credit.html
Added Paths:
-----------
trunk/UI/Contact/divs/address.html
trunk/UI/Contact/divs/employee.html
Modified: trunk/UI/Contact/contact.html
===================================================================
--- trunk/UI/Contact/contact.html 2012-03-19 09:12:59 UTC (rev 4509)
+++ trunk/UI/Contact/contact.html 2012-03-19 09:43:12 UTC (rev 4510)
@@ -1,4 +1,3 @@
-<?lsmb
INCLUDE 'ui-header.html'
stylesheet = USER.stylesheet
@@ -65,7 +64,10 @@
<?lsmb # TODO: Move to controller scripts.
nav_list = [];
IF entity_class == 3;
- DIVS.push({id = 'hr_div', label = text('HR')});
+ DIVS.push({id = 'hr_div',
+ label = text('HR'),
+ template = 'employee'}
+ );
ELSE;
DIVS.push({id = 'company_div',
label = text('Company'),
@@ -77,12 +79,15 @@
END;
IF entity_id;
DIVS.push(
- {id = 'location_div', label = text('Addresses')},
+ {id = 'location_div',
+ label = text('Addresses'),
+ template = 'address'},
{id = 'contact_div', label = text('Contact Info')}, #'
{id = 'bank_div', label = text('Bank Accounts')}, #'
{id = 'notes_div', label = text('Notes')}
);
IF account_class == 1 or account_class == 2;
+ #DIVS.push({id = 'tasks_div', label = text('Tasks')});
#DIVS.push({id = 'prices_div', label = text('Pricelist')});
#DIVS.push({id = 'history_div', label = text('History')});
ELSIF account_class == 3;
@@ -101,355 +106,6 @@
END
END
?>
-</div>
-<?lsmb IF entity_class == 3 ?>
-<div id="hr_div" class="container">
- <div class="listtop"><strong><?lsmb text("$operation Employee") ?></strong></div>
-<form name="hr" action="<?lsmb script ?>" method="post">
-<?lsmb PROCESS input element_data = {
- type = "hidden"
- name = "target_div"
- value = 'hr_div'
- } ?>
-<?lsmb PROCESS input element_data = {
- type = "hidden"
- name = "form_id"
- value = form_id
- } ?>
-<?lsmb PROCESS input element_data = {
- type = "hidden"
- name = "entity_id"
- value = entity_id
-} ?>
-<div class="input_line" id="person_name_div"><?lsmb #text('Name:')?>
-<div class="input_group">
-<!-- TODO: Add Saluatation -->
-<?lsmb PROCESS input element_data = {
- label = text('First Name') #'
- name = "first_name"
- value = first_name
- type = "text"
- size = 20
-} ?>
-</div>
-<div class="input_group">
-<?lsmb PROCESS input element_data = {
- label = text('Middle Name') #'
- name = "middle_name"
- value = middle_name
- type = "text"
- size = 20
-} ?>
-</div>
-</div>
-<div class="input_line" id='person_name2_div'>
-<div class="input_group">
-<?lsmb PROCESS input element_data = {
- label = text('Last Name') #'
- name = "last_name"
- value = last_name
- type = "text"
- size = 20
-} ?>
-</div>
-<!-- Note that the strange # ' constructs are only necessary to help VIM avoid
-problems with multi-word single-quoted constructs in PI tags. -CT -->
-<div class="input_group">
-<?lsmb PROCESS input element_data = {
- label = text('Job Title')
- name = "role"
- value = role
- type = "text"
- size = 20
-} # ' ?>
-</div>
-</div>
-<div class="input_line" id="person-role-div">
-<div class="input_group">
-<?lsmb PROCESS input element_data = {
- label = text('Sales')
- value = 1
- type = "checkbox"
- checked = sales
- name = "sales"
-} ?>
-</div>
-<div class="input_group">
-<?lsmb PROCESS input element_data = {
- label = text('Manager')
- value = 'manager'
- type = "checkbox"
- checked = is_manager
- name = "is_manager"
-} ?>
-</div>
-</div>
-<div class="input_line" id="person-country-div">
-<div class="input_group">
- <?lsmb country_list.unshift({}) ?>
- <?lsmb INCLUDE select element_data = {
- text_attr = "name"
- value_attr = "id"
- default_values = [country_id]
- options = country_list
- name = "country_id"
- label = text('Country')
- } ?>
-</div>
-</div>
-<div id="employee_div">
-<div class="input_group">
-<?lsmb PROCESS input element_data = {
- label = text('Employee Number')
- value = employeenumber
- name = "employeenumber"
- type = "text"
- size = 20
-} # ' ?>
-</div>
-<div class="input_group">
-<?lsmb PROCESS select element_data = {
- label = text('Manager')
- name = 'manager_id'
- options = all_managers
-default_values = [manager_id]
- text_attr = 'label'
- value_attr = 'id'
-} ?>
-</div>
-<div id="hr_dates_div">
-<div class="input_group">
-<?lsmb PROCESS input element_data = {
- label = text('DOB')
- name = "dob"
- value = dob
- type = "text"
- class = "date"
- size = 10
-} ?>
-</div>
-<div class="input_group">
-<?lsmb PROCESS input element_data = {
- label = text('Start Date')
- name = "start_date"
- value = start_date
- type = "text"
- class = "date"
- size = 10
-} # ' ?>
-</div>
-<div class="input_group">
-<?lsmb PROCESS input element_data = {
- label = text('End Date')
- name = "end_date"
- value = end_date
- class = "text"
- type = "text"
- size = 10
-} # ' ?>
-</div>
-</div>
-<div>
-<?lsmb PROCESS button element_data = {
- text = text('Save')
- class = "submit"
- type = "submit"
- name = 'action'
- value = "save"
-} ?>
-<?lsmb
-IF manage_users and entity_id;
- IF user_id ?>
- <a href="admin.pl?action=edit_user&user_id=<?lsmb user_id ?>"
- >[<?lsmb text('Edit User') ?>]</a><?lsmb
- ELSE ?>
- <a href="admin.pl?action=new_user&first_name=<?lsmb tt_url(first_name)
- ?>&last_name=<?lsmb tt_url(last_name)
- ?>&employeenumber=<?lsmb tt_url(employeenumber)
- ?>&country_id=<?lsmb tt_url(country_id)
- ?>&entity_id=<?lsmb tt_url(entity_id) ?>"
- >[<?lsmb text('Add User') ?>]</a><?lsmb
- END;
-END ?>
-</div>
-</form>
-</div>
-<?lsmb END ?>
-<?lsmb IF entity_id and ((entity_class == 3) or (credit_id)) ?>
-<div id="location_div" class="container">
- <div class="listtop"><?lsmb text('Locations') ?></div>
- <!-- This entire form should probably be optionaly automated with AJAX
- in order to prevent user confusion -CT -->
- <form id="location_form" action="<?lsmb script ?>">
-<?lsmb PROCESS input element_data = {
- type = "hidden"
- name = "form_id"
- value = form_id
- } ?>
-<?lsmb PROCESS input element_data = {
- type = "hidden"
- name = "old_location_class"
- value = location_class
- } ?>
-<?lsmb PROCESS input element_data = {
- type = "hidden"
- name = "target_div"
- value = 'location_div'
- } ?>
- <?lsmb PROCESS input element_data = {
- type="hidden"
- name="entity_id"
- value=entity_id
- } ?>
- <?lsmb PROCESS input element_data = {
- type="hidden"
- name="credit_id"
- value=credit_id
- } ?>
- <?lsmb PROCESS input element_data = {
- type="hidden"
- name="location_id"
- value=location_id
- } ?>
- <table width="100%">
- <tr class="listheading">
- <th class="type"><?lsmb text('Type') ?></th>
- <th class="line_one"><?lsmb text('Address1') ?></th>
- <th class="city"><?lsmb text('City') ?></th>
- <th class="state"><?lsmb text('State/Province') ?></th>
- <th class="mail_code"><?lsmb text('ZIP/Post Code') ?></th>
- <th class="country"><?lsmb text('Country') ?></th>
- <th class="actions"><?lsmb text('Actions') ?></th>
- </tr>
- <?lsmb FOREACH loc = locations ?>
- <?lsmb IF location_id == loc.id;
- FOREACH key = loc.keys();
- $key = loc.$key;
- END;
- END;
- ?>
- <tr <?lsmb IF location_id == loc.id ?> class="active" <?lsmb END ?>>
- <td class="type"><?lsmb loc.class ?></td>
- <td class="line_one"><?lsmb loc.line_one ?></td>
- <td class="city"><?lsmb loc.city ?></td>
- <td class="state"><?lsmb loc.state ?></td>
- <td class="mail_code"><?lsmb loc.mail_code ?></td>
- <td class="country"><?lsmb loc.country ?></td>
- <td class="actions">
- <!-- TODO: Automate links with AJAX -->
- <a href="<?lsmb script ?>?action=edit&entity_id=<?lsmb entity_id
- ?>&location_id=<?lsmb loc.id ?>&credit_id=<?lsmb
- credit_id ?>&country_code=<?lsmb loc.country_id
- ?>&target_div=location_div&location_class=<?lsmb
- loc.class_id ?>&person_id=<?lsmb tt_url(person_id)
- ?>">[edit]</a>
- <a href="<?lsmb script ?>?action=delete_location&entity_id=<?lsmb
- entity_id ?>&location_id=<?lsmb loc.id
- ?>&credit_id=<?lsmb credit_id
- ?>&form_id=<?lsmb form_id
- ?>&location_class=<?lsmb loc.class_id
- ?>&target_div=location_div&person_id=<?lsmb person_id
- ?>">[delete]</a>
- </td>
- </tr>
- <?lsmb END ?>
- </table>
- <div>
- <?lsmb INCLUDE select element_data = {
- name = "location_class"
- default_values = [location_class]
- options = location_class_list
- text_attr = "class"
- value_attr = "id"
- label = text('Type')
- } ?>
- </select>
- </div>
- <div>
- <?lsmb INCLUDE input element_data = {
- label = text('Address'),
- name = "line_one",
- value = line_one,
- type = "text",
- size = "20"
- } ?>
- </div>
- <div>
- <?lsmb PROCESS input element_data = {
- label = ":"
- name = "line_two"
- class = "addl-address"
- value = line_two
- type = "text"
- size = "20"
- } ?>
- </div>
- <div>
- <?lsmb PROCESS input element_data = {
- label = ":"
- name = "line_three"
- class = "addl-address"
- value = line_three
- type = "text"
- size = "20"
- } ?>
- </div>
- <div>
- <?lsmb PROCESS input element_data = {
- label = text('City'),
- name = "city",
- value = city,
- type = "text",
- size = "20"
- } ?>
- </div>
- <div>
- <?lsmb PROCESS input element_data = {
- label = text('State/Province'),
- name = "state",
- value = state,
- type = "text",
- size = "20"
- } ?>
- </div>
- <div>
- <?lsmb PROCESS input element_data = {
- label = text('Zip/Post Code'),
- name = "mail_code",
- value = mail_code,
- type = "text",
- size = "20"
- } #' ?>
- </div>
- <div>
- <?lsmb IF !country_code; country_code = default_country; END -?>
- <?lsmb INCLUDE select element_data = {
- text_attr = "name"
- value_attr = "id"
- default_values = [country_code]
- options = country_list
- name = "country_code"
- label = text('Country')
- } ?>
- </div>
- <div>
- <?lsmb PROCESS button element_data = {
- class = "submit"
- name = "action"
- value = "add_location"
- id = "loc_save_location"
- text = text('Save Location')
- } #' ?>
- <?lsmb PROCESS button element_data = {
- class = "submit"
- name = "action"
- value = "save_new_location"
- id = "loc_save_new_location"
- text = text('Save New Location')
- } #' ?>
- </div>
- </form>
-</div>
<div class="container" id="contact_div">
<div class="listtop"><?lsmb text('Contact Information') ?></div>
<table width="100%">
Added: trunk/UI/Contact/divs/address.html
===================================================================
--- trunk/UI/Contact/divs/address.html (rev 0)
+++ trunk/UI/Contact/divs/address.html 2012-03-19 09:43:12 UTC (rev 4510)
@@ -0,0 +1,174 @@
+<div id="location_div" class="container">
+ <div class="listtop"><?lsmb text('Locations') ?></div>
+ <!-- This entire form should probably be optionaly automated with AJAX
+ in order to prevent user confusion -CT -->
+ <form id="location_form" action="<?lsmb script ?>">
+<?lsmb PROCESS input element_data = {
+ type = "hidden"
+ name = "form_id"
+ value = form_id
+ } ?>
+<?lsmb PROCESS input element_data = {
+ type = "hidden"
+ name = "old_location_class"
+ value = location_class
+ } ?>
+<?lsmb PROCESS input element_data = {
+ type = "hidden"
+ name = "target_div"
+ value = 'location_div'
+ } ?>
+ <?lsmb PROCESS input element_data = {
+ type="hidden"
+ name="entity_id"
+ value=entity_id
+ } ?>
+ <?lsmb PROCESS input element_data = {
+ type="hidden"
+ name="credit_id"
+ value=credit_id
+ } ?>
+ <?lsmb PROCESS input element_data = {
+ type="hidden"
+ name="location_id"
+ value=location_id
+ } ?>
+ <table width="100%">
+ <tr class="listheading">
+ <th class="type"><?lsmb text('Type') ?></th>
+ <th class="line_one"><?lsmb text('Address1') ?></th>
+ <th class="city"><?lsmb text('City') ?></th>
+ <th class="state"><?lsmb text('State/Province') ?></th>
+ <th class="mail_code"><?lsmb text('ZIP/Post Code') ?></th>
+ <th class="country"><?lsmb text('Country') ?></th>
+ <th class="actions"><?lsmb text('Actions') ?></th>
+ </tr>
+ <?lsmb FOREACH loc = locations ?>
+ <?lsmb IF location_id == loc.id;
+ FOREACH key = loc.keys();
+ $key = loc.$key;
+ END;
+ END;
+ ?>
+ <tr <?lsmb IF location_id == loc.id ?> class="active" <?lsmb END ?>>
+ <td class="type"><?lsmb loc.class ?></td>
+ <td class="line_one"><?lsmb loc.line_one ?></td>
+ <td class="city"><?lsmb loc.city ?></td>
+ <td class="state"><?lsmb loc.state ?></td>
+ <td class="mail_code"><?lsmb loc.mail_code ?></td>
+ <td class="country"><?lsmb loc.country ?></td>
+ <td class="actions">
+ <!-- TODO: Automate links with AJAX -->
+ <a href="<?lsmb script ?>?action=edit&entity_id=<?lsmb entity_id
+ ?>&location_id=<?lsmb loc.id ?>&credit_id=<?lsmb
+ credit_id ?>&country_code=<?lsmb loc.country_id
+ ?>&target_div=location_div&location_class=<?lsmb
+ loc.class_id ?>&person_id=<?lsmb tt_url(person_id)
+ ?>">[edit]</a>
+ <a href="<?lsmb script ?>?action=delete_location&entity_id=<?lsmb
+ entity_id ?>&location_id=<?lsmb loc.id
+ ?>&credit_id=<?lsmb credit_id
+ ?>&form_id=<?lsmb form_id
+ ?>&location_class=<?lsmb loc.class_id
+ ?>&target_div=location_div&person_id=<?lsmb person_id
+ ?>">[delete]</a>
+ </td>
+ </tr>
+ <?lsmb END ?>
+ </table>
+ <div>
+ <?lsmb INCLUDE select element_data = {
+ name = "location_class"
+ default_values = [location_class]
+ options = location_class_list
+ text_attr = "class"
+ value_attr = "id"
+ label = text('Type')
+ } ?>
+ </select>
+ </div>
+ <div>
+ <?lsmb INCLUDE input element_data = {
+ label = text('Address'),
+ name = "line_one",
+ value = line_one,
+ type = "text",
+ size = "20"
+ } ?>
+ </div>
+ <div>
+ <?lsmb PROCESS input element_data = {
+ label = ":"
+ name = "line_two"
+ class = "addl-address"
+ value = line_two
+ type = "text"
+ size = "20"
+ } ?>
+ </div>
+ <div>
+ <?lsmb PROCESS input element_data = {
+ label = ":"
+ name = "line_three"
+ class = "addl-address"
+ value = line_three
+ type = "text"
+ size = "20"
+ } ?>
+ </div>
+ <div>
+ <?lsmb PROCESS input element_data = {
+ label = text('City'),
+ name = "city",
+ value = city,
+ type = "text",
+ size = "20"
+ } ?>
+ </div>
+ <div>
+ <?lsmb PROCESS input element_data = {
+ label = text('State/Province'),
+ name = "state",
+ value = state,
+ type = "text",
+ size = "20"
+ } ?>
+ </div>
+ <div>
+ <?lsmb PROCESS input element_data = {
+ label = text('Zip/Post Code'),
+ name = "mail_code",
+ value = mail_code,
+ type = "text",
+ size = "20"
+ } #' ?>
+ </div>
+ <div>
+ <?lsmb IF !country_code; country_code = default_country; END -?>
+ <?lsmb INCLUDE select element_data = {
+ text_attr = "name"
+ value_attr = "id"
+ default_values = [country_code]
+ options = country_list
+ name = "country_code"
+ label = text('Country')
+ } ?>
+ </div>
+ <div>
+ <?lsmb PROCESS button element_data = {
+ class = "submit"
+ name = "action"
+ value = "add_location"
+ id = "loc_save_location"
+ text = text('Save Location')
+ } #' ?>
+ <?lsmb PROCESS button element_data = {
+ class = "submit"
+ name = "action"
+ value = "save_new_location"
+ id = "loc_save_new_location"
+ text = text('Save New Location')
+ } #' ?>
+ </div>
+ </form>
+</div>
Modified: trunk/UI/Contact/divs/credit.html
===================================================================
--- trunk/UI/Contact/divs/credit.html 2012-03-19 09:12:59 UTC (rev 4509)
+++ trunk/UI/Contact/divs/credit.html 2012-03-19 09:43:12 UTC (rev 4510)
@@ -322,3 +322,4 @@
</form>
</div>
<?lsmb END ?>
+</div>
Added: trunk/UI/Contact/divs/employee.html
===================================================================
--- trunk/UI/Contact/divs/employee.html (rev 0)
+++ trunk/UI/Contact/divs/employee.html 2012-03-19 09:43:12 UTC (rev 4510)
@@ -0,0 +1,171 @@
+<div id="hr_div" class="container">
+ <div class="listtop"><strong><?lsmb text("$operation Employee") ?></strong></div>
+<form name="hr" action="<?lsmb script ?>" method="post">
+<?lsmb PROCESS input element_data = {
+ type = "hidden"
+ name = "target_div"
+ value = 'hr_div'
+ } ?>
+<?lsmb PROCESS input element_data = {
+ type = "hidden"
+ name = "form_id"
+ value = form_id
+ } ?>
+<?lsmb PROCESS input element_data = {
+ type = "hidden"
+ name = "entity_id"
+ value = entity_id
+} ?>
+<div class="input_line" id="person_name_div"><?lsmb #text('Name:')?>
+<div class="input_group">
+<!-- TODO: Add Saluatation -->
+<?lsmb PROCESS input element_data = {
+ label = text('First Name') #'
+ name = "first_name"
+ value = first_name
+ type = "text"
+ size = 20
+} ?>
+</div>
+<div class="input_group">
+<?lsmb PROCESS input element_data = {
+ label = text('Middle Name') #'
+ name = "middle_name"
+ value = middle_name
+ type = "text"
+ size = 20
+} ?>
+</div>
+</div>
+<div class="input_line" id='person_name2_div'>
+<div class="input_group">
+<?lsmb PROCESS input element_data = {
+ label = text('Last Name') #'
+ name = "last_name"
+ value = last_name
+ type = "text"
+ size = 20
+} ?>
+</div>
+<!-- Note that the strange # ' constructs are only necessary to help VIM avoid
+problems with multi-word single-quoted constructs in PI tags. -CT -->
+<div class="input_group">
+<?lsmb PROCESS input element_data = {
+ label = text('Job Title')
+ name = "role"
+ value = role
+ type = "text"
+ size = 20
+} # ' ?>
+</div>
+</div>
+<div class="input_line" id="person-role-div">
+<div class="input_group">
+<?lsmb PROCESS input element_data = {
+ label = text('Sales')
+ value = 1
+ type = "checkbox"
+ checked = sales
+ name = "sales"
+} ?>
+</div>
+<div class="input_group">
+<?lsmb PROCESS input element_data = {
+ label = text('Manager')
+ value = 'manager'
+ type = "checkbox"
+ checked = is_manager
+ name = "is_manager"
+} ?>
+</div>
+</div>
+<div class="input_line" id="person-country-div">
+<div class="input_group">
+ <?lsmb country_list.unshift({}) ?>
+ <?lsmb INCLUDE select element_data = {
+ text_attr = "name"
+ value_attr = "id"
+ default_values = [country_id]
+ options = country_list
+ name = "country_id"
+ label = text('Country')
+ } ?>
+</div>
+</div>
+<div id="employee_div">
+<div class="input_group">
+<?lsmb PROCESS input element_data = {
+ label = text('Employee Number')
+ value = employeenumber
+ name = "employeenumber"
+ type = "text"
+ size = 20
+} # ' ?>
+</div>
+<div class="input_group">
+<?lsmb PROCESS select element_data = {
+ label = text('Manager')
+ name = 'manager_id'
+ options = all_managers
+default_values = [manager_id]
+ text_attr = 'label'
+ value_attr = 'id'
+} ?>
+</div>
+<div id="hr_dates_div">
+<div class="input_group">
+<?lsmb PROCESS input element_data = {
+ label = text('DOB')
+ name = "dob"
+ value = dob
+ type = "text"
+ class = "date"
+ size = 10
+} ?>
+</div>
+<div class="input_group">
+<?lsmb PROCESS input element_data = {
+ label = text('Start Date')
+ name = "start_date"
+ value = start_date
+ type = "text"
+ class = "date"
+ size = 10
+} # ' ?>
+</div>
+<div class="input_group">
+<?lsmb PROCESS input element_data = {
+ label = text('End Date')
+ name = "end_date"
+ value = end_date
+ class = "text"
+ type = "text"
+ size = 10
+} # ' ?>
+</div>
+</div>
+<div>
+<?lsmb PROCESS button element_data = {
+ text = text('Save')
+ class = "submit"
+ type = "submit"
+ name = 'action'
+ value = "save"
+} ?>
+<?lsmb
+IF manage_users and entity_id;
+ IF user_id ?>
+ <a href="admin.pl?action=edit_user&user_id=<?lsmb user_id ?>"
+ >[<?lsmb text('Edit User') ?>]</a><?lsmb
+ ELSE ?>
+ <a href="admin.pl?action=new_user&first_name=<?lsmb tt_url(first_name)
+ ?>&last_name=<?lsmb tt_url(last_name)
+ ?>&employeenumber=<?lsmb tt_url(employeenumber)
+ ?>&country_id=<?lsmb tt_url(country_id)
+ ?>&entity_id=<?lsmb tt_url(entity_id) ?>"
+ >[<?lsmb text('Add User') ?>]</a><?lsmb
+ END;
+END ?>
+</div>
+</form>
+</div>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.