diff --git a/bt5/erp5_travel_expense/ActionTemplateItem/portal_types/Service/jio_view.xml b/bt5/erp5_travel_expense/ActionTemplateItem/portal_types/Service/jio_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..91ec49ca2ec121a6f4e862a096ec1ee9058678ee --- /dev/null +++ b/bt5/erp5_travel_expense/ActionTemplateItem/portal_types/Service/jio_view.xml @@ -0,0 +1,87 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ActionInformation" module="Products.CMFCore.ActionInformation"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>action</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>categories</string> </key> + <value> + <tuple> + <string>action_type/object_jio_view</string> + </tuple> + </value> + </item> + <item> + <key> <string>category</string> </key> + <value> <string>object_jio_view</string> </value> + </item> + <item> + <key> <string>condition</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>icon</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>jio_view</string> </value> + </item> + <item> + <key> <string>permissions</string> </key> + <value> + <tuple> + <string>View</string> + </tuple> + </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Action Information</string> </value> + </item> + <item> + <key> <string>priority</string> </key> + <value> <float>100.0</float> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>visible</string> </key> + <value> <int>1</int> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <global name="Expression" module="Products.CMFCore.Expression"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>text</string> </key> + <value> <string>string:${object_url}/Service_viewAsJio</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_travel_expense/PathTemplateItem/portal_categories/use/hr.xml b/bt5/erp5_travel_expense/PathTemplateItem/portal_categories/use/hr.xml new file mode 100644 index 0000000000000000000000000000000000000000..e36dcfef9820a8be3130268343dee969d34c202e --- /dev/null +++ b/bt5/erp5_travel_expense/PathTemplateItem/portal_categories/use/hr.xml @@ -0,0 +1,137 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Category" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_Add_portal_content_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Add_portal_folders_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Copy_or_Move_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Delete_objects_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Modify_portal_content_Permission</string> </key> + <value> + <tuple> + <string>Assignee</string> + <string>Assignor</string> + <string>Manager</string> + <string>Owner</string> + </tuple> + </value> + </item> + <item> + <key> <string>_count</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>_mt_index</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + </value> + </item> + <item> + <key> <string>_tree</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> + </value> + </item> + <item> + <key> <string>categories</string> </key> + <value> + <tuple> + <string>use/hr</string> + </tuple> + </value> + </item> + <item> + <key> <string>codification</string> </key> + <value> <string>HR</string> </value> + </item> + <item> + <key> <string>default_reference</string> </key> + <value> <string>HR</string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>hr</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Category</string> </value> + </item> + <item> + <key> <string>short_title</string> </key> + <value> <string>HR</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Human Resources</string> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <global name="Length" module="BTrees.Length"/> + </pickle> + <pickle> <int>0</int> </pickle> + </record> + <record id="3" aka="AAAAAAAAAAM="> + <pickle> + <global name="OOBTree" module="BTrees.OOBTree"/> + </pickle> + <pickle> + <none/> + </pickle> + </record> + <record id="4" aka="AAAAAAAAAAQ="> + <pickle> + <global name="OOBTree" module="BTrees.OOBTree"/> + </pickle> + <pickle> + <none/> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_travel_expense/PathTemplateItem/portal_categories/use/hr/expense_validation_request.xml b/bt5/erp5_travel_expense/PathTemplateItem/portal_categories/use/hr/expense_validation_request.xml new file mode 100644 index 0000000000000000000000000000000000000000..2298088a574ee3032b988120e3d623fba7f777a7 --- /dev/null +++ b/bt5/erp5_travel_expense/PathTemplateItem/portal_categories/use/hr/expense_validation_request.xml @@ -0,0 +1,97 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Category" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_Add_portal_content_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Add_portal_folders_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Copy_or_Move_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Delete_objects_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Modify_portal_content_Permission</string> </key> + <value> + <tuple> + <string>Assignee</string> + <string>Assignor</string> + <string>Manager</string> + <string>Owner</string> + </tuple> + </value> + </item> + <item> + <key> <string>categories</string> </key> + <value> + <tuple> + <string>use/hr/expense_validation_request</string> + </tuple> + </value> + </item> + <item> + <key> <string>codification</string> </key> + <value> <string>EVR</string> </value> + </item> + <item> + <key> <string>default_reference</string> </key> + <value> <string>EVR</string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>expense_validation_request</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Category</string> </value> + </item> + <item> + <key> <string>short_title</string> </key> + <value> <string>Expense Validation</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Expense Validation Request</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_travel_expense/PathTemplateItem/portal_categories/use/hr/travel_request.xml b/bt5/erp5_travel_expense/PathTemplateItem/portal_categories/use/hr/travel_request.xml new file mode 100644 index 0000000000000000000000000000000000000000..0bbc97cf9e6e58d6ca42d7629d45d31fbcf43805 --- /dev/null +++ b/bt5/erp5_travel_expense/PathTemplateItem/portal_categories/use/hr/travel_request.xml @@ -0,0 +1,97 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Category" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_Add_portal_content_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Add_portal_folders_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Copy_or_Move_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Delete_objects_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Modify_portal_content_Permission</string> </key> + <value> + <tuple> + <string>Assignee</string> + <string>Assignor</string> + <string>Manager</string> + <string>Owner</string> + </tuple> + </value> + </item> + <item> + <key> <string>categories</string> </key> + <value> + <tuple> + <string>use/hr/travel_request</string> + </tuple> + </value> + </item> + <item> + <key> <string>codification</string> </key> + <value> <string>TR</string> </value> + </item> + <item> + <key> <string>default_reference</string> </key> + <value> <string>TR</string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>travel_request</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Category</string> </value> + </item> + <item> + <key> <string>short_title</string> </key> + <value> <string>Travel Request</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Travel Request</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_js.js b/bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_js.js index 6196e4a1e60b468db72b910b1ddda15fd4148bc2..5b610c46f9da0e6f2cc6fa355c800cf1da49f7af 100644 --- a/bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_js.js +++ b/bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_js.js @@ -85,6 +85,9 @@ column_list: [{ select: 'comment', title: 'Description' + }, { + select: 'type_title', + title: 'Type' }, { select: 'quantity', title: 'Total Price' @@ -104,9 +107,9 @@ query: { query: 'portal_type:("Expense Record" OR "Expense Record Temp")', select_list: ['doc_id', 'quantity', 'resource_title', - 'comment', 'date', 'portal_type', 'sync_flag', + 'comment', 'date', 'type_title', 'state'], - sort_on: [["doc_id", "descending"]] + sort_on: [["modification_date", "descending"]] } }); }); diff --git a/bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_html.html b/bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_html.html index 2bd2c89902995d62594a1cbc6638e977e33f5766..baad2d7fc23aa9282021b74a3ca95c459e981ef9 100644 --- a/bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_html.html +++ b/bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_html.html @@ -59,6 +59,19 @@ </select> </div> + <div class="ui-field-contain"> + <label data-i18n="Type">Type</label> + <select class="new-performed-task" name="type" required> + {{#each type_options}} + {{#if is_selected}} + <option value={{value}} selected>{{title}}</option> + {{else}} + <option value={{value}}>{{title}}</option> + {{/if}} + {{/each}} + </select> + </div> + <div class="ui-field-contain"> <label data-i18n="Photo">Photo</label> <input name="photo" type="file" accept="image/*" capture="camera"> @@ -135,6 +148,19 @@ </select> </div> + <div class="ui-field-contain" class='ui-state-readonly'> + <label data-i18n="Type">Type</label> + <select name="type" readonly class='ui-state-readonly'> + {{#each type_options}} + {{#if is_selected}} + <option value={{value}} selected>{{title}}</option> + {{else}} + <option value={{value}}>{{title}}</option> + {{/if}} + {{/each}} + </select> + </div> + <div class="ui-field-contain" style="display:none;"> <label data-i18n="Photo">Photo</label> <input name="photo" type="file" accept="image/*" capture="camera" readonly class='ui-state-readonly'> diff --git a/bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_js.js b/bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_js.js index c612fd45df326ed006b8a9d95569d232e783eab6..de831845712663705acf2c91b23dc041bab77619 100644 --- a/bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_js.js +++ b/bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_js.js @@ -48,10 +48,12 @@ if (form[i].name === "photo") { continue; } - doc[form[i].name] = form[i].value; - if (form[i].name === 'resource') { - doc.resource_title = form[i][form[i].selectedIndex].text; + if (form[i].nodeName === "SELECT"){ + doc[form[i].name] = form[i].value; + doc[form[i].name + "_title"] = + form[i].options[form[i].selectedIndex].text; } + doc[form[i].name] = form[i].value; } } if (doc.sync_flag === "1"){ @@ -74,6 +76,34 @@ return sync_state; } + function getTypeSelectList(gadget, doc) { + return new RSVP.Queue() + .push(function (){ + return gadget.allDocs({ + query: 'portal_type:"Service" AND use:"hr/expense_validation_request%"', + select_list: ['relative_url', 'title'], + limit: [0, 100] + }); + }) + .push(function (result) { + var i = 0, + tmp, + ops, + select_options = []; + for (i = 0; i < result.data.total_rows; i += 1) { + tmp = { + title: result.data.rows[i].value.title, + value: result.data.rows[i].value.relative_url + }; + if (doc.type === result.data.rows[i].value.relative_url) { + tmp.is_selected = true; + } + select_options.push(tmp); + } + return select_options; + }); + } + function geoLocationPromise() { return new Promise(function (resolve, reject) { var err; @@ -231,17 +261,21 @@ geoLocation = {coords: {latitude: "", longitude: ""}}; } gadget.props.geoLocation = geoLocation; - return gadget.allDocs({ - query: 'portal_type:"Currency"', - select_list: ['relative_url', 'title'], - limit: [0, 100] - }); + return RSVP.all([ + gadget.allDocs({ + query: 'portal_type:"Currency"', + select_list: ['relative_url', 'title'], + limit: [0, 100] + }), + getTypeSelectList(gadget, options.doc) + ]); }) - .push(function (result) { + .push(function (result_list) { var i = 0, tmp, ops, - select_options = []; + select_options = [], + result = result_list[0]; if (options.doc.resource === undefined) { options.doc.resource = "currency_module/2"; } @@ -269,6 +303,7 @@ sync_checked: sync_checked, not_sync_checked: not_sync_checked, select_options: select_options, + type_options: result_list[1], longitude: geoLocation.coords.longitude || "", latitude: geoLocation.coords.latitude || "", related_mission_url: related_mission_url || "", @@ -626,4 +661,4 @@ ); }); -}(window, document, RSVP, rJS, Handlebars, loopEventListener, promiseEventListener, alertify)); \ No newline at end of file +}(window, document, RSVP, rJS, Handlebars, loopEventListener, promiseEventListener, alertify)); diff --git a/bt5/erp5_travel_expense/PropertySheetTemplateItem/portal_property_sheets/ExpenseRecord/type_property.xml b/bt5/erp5_travel_expense/PropertySheetTemplateItem/portal_property_sheets/ExpenseRecord/type_property.xml new file mode 100644 index 0000000000000000000000000000000000000000..c77a4d27f6fd049002c7f7aaf8ce8f146df75e83 --- /dev/null +++ b/bt5/erp5_travel_expense/PropertySheetTemplateItem/portal_property_sheets/ExpenseRecord/type_property.xml @@ -0,0 +1,38 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Standard Property" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>categories</string> </key> + <value> + <tuple> + <string>elementary_type/string</string> + </tuple> + </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>type_property</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Standard Property</string> </value> + </item> + <item> + <key> <string>property_default</string> </key> + <value> <string>python: ""</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_travel_expense/PropertySheetTemplateItem/portal_property_sheets/ExpenseRecord/type_title_property.xml b/bt5/erp5_travel_expense/PropertySheetTemplateItem/portal_property_sheets/ExpenseRecord/type_title_property.xml new file mode 100644 index 0000000000000000000000000000000000000000..8095f89f340c59aee678e832dd27cfda261796a3 --- /dev/null +++ b/bt5/erp5_travel_expense/PropertySheetTemplateItem/portal_property_sheets/ExpenseRecord/type_title_property.xml @@ -0,0 +1,38 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Standard Property" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>categories</string> </key> + <value> + <tuple> + <string>elementary_type/string</string> + </tuple> + </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>type_title_property</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Standard Property</string> </value> + </item> + <item> + <key> <string>property_default</string> </key> + <value> <string>python: ""</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ERP5Site_getPreferredExpenseDocumentPublicationSectionValue.py b/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ERP5Site_getPreferredExpenseDocumentPublicationSectionValue.py new file mode 100644 index 0000000000000000000000000000000000000000..452da3fae025ca53f476e253c0bb51419db6910f --- /dev/null +++ b/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ERP5Site_getPreferredExpenseDocumentPublicationSectionValue.py @@ -0,0 +1 @@ +raise ValueError("Not Implemented") diff --git a/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ERP5Site_getPreferredExpenseDocumentPublicationSectionValue.xml b/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ERP5Site_getPreferredExpenseDocumentPublicationSectionValue.xml new file mode 100644 index 0000000000000000000000000000000000000000..3c701423d9ae94a9f5325154593b80e04330b684 --- /dev/null +++ b/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ERP5Site_getPreferredExpenseDocumentPublicationSectionValue.xml @@ -0,0 +1,62 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>Script_magic</string> </key> + <value> <int>3</int> </value> + </item> + <item> + <key> <string>_bind_names</string> </key> + <value> + <object> + <klass> + <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/> + </klass> + <tuple/> + <state> + <dictionary> + <item> + <key> <string>_asgns</string> </key> + <value> + <dictionary> + <item> + <key> <string>name_container</string> </key> + <value> <string>container</string> </value> + </item> + <item> + <key> <string>name_context</string> </key> + <value> <string>context</string> </value> + </item> + <item> + <key> <string>name_m_self</string> </key> + <value> <string>script</string> </value> + </item> + <item> + <key> <string>name_subpath</string> </key> + <value> <string>traverse_subpath</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>_params</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>ERP5Site_getPreferredExpenseDocumentPublicationSectionValue</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ExpenseRecord_updateRelatedTicket.py b/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ExpenseRecord_updateRelatedTicket.py index 49c39f09f7a1d5e79dfac37675738a317e3388d0..19780cc0ac40506c838f79d14c548b3aa6cc50b2 100644 --- a/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ExpenseRecord_updateRelatedTicket.py +++ b/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ExpenseRecord_updateRelatedTicket.py @@ -18,7 +18,6 @@ else: ticket = record.getFollowUpValue() record.setDestinationReference(ticket.getReference()) - record.setFollowUpValue(ticket) related_mission_url = record.getRelatedMissionUrl() @@ -29,7 +28,7 @@ else: source_project_url = "" ticket.edit( title=record.getTitle(), - #resource=record.getSource(), + resource=record.getType(), start_date=DateTime(record.getDate()), stop_date=DateTime(record.getDate()), # Specific @@ -40,11 +39,24 @@ ticket.edit( description=record.getComment(), latitude=record.getLatitude(), longitude=record.getLongitude(), - source_project=source_project_url + source_project=source_project_url, ) + +publication_section = portal.ERP5Site_getPreferredExpenseDocumentPublicationSectionValue() photo_data = record.getPhotoData() if photo_data: - ticket.setPhotoData(photo_data) + if "," in photo_data and ticket: + photo_data = photo_data.split(",")[1] + image = portal.portal_contributions.newContent( + data = photo_data.decode('base64'), + reference=ticket.getReference()+ "-justificatif", + title = ticket.getReference() + " Justificatif", + description = ticket.getDescription(), + filename="tmp.png", + follow_up=ticket.getRelativeUrl(), + publication_section=publication_section.getRelativeUrl(), + ) + image.share() record.deliver() diff --git a/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ExpenseRecord_viewAsJio.xml b/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ExpenseRecord_viewAsJio.xml index 7805c82b74dc45a5331564a8e41565584557aa40..25af87e846b62af7c0798362aad85370f64eec68 100644 --- a/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ExpenseRecord_viewAsJio.xml +++ b/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ExpenseRecord_viewAsJio.xml @@ -94,6 +94,8 @@ <string>your_title</string> <string>my_related_mission_url</string> <string>my_related_mission</string> + <string>my_type</string> + <string>my_type_title</string> </list> </value> </item> diff --git a/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ExpenseRecord_viewAsJio/my_type.xml b/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ExpenseRecord_viewAsJio/my_type.xml new file mode 100644 index 0000000000000000000000000000000000000000..802bbce98fe31112bf7d2652e2af7da7ed9ddd82 --- /dev/null +++ b/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ExpenseRecord_viewAsJio/my_type.xml @@ -0,0 +1,264 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="StringField" module="Products.Formulator.StandardFields"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>my_type</string> </value> + </item> + <item> + <key> <string>message_values</string> </key> + <value> + <dictionary> + <item> + <key> <string>external_validator_failed</string> </key> + <value> <string>The input failed the external validator.</string> </value> + </item> + <item> + <key> <string>required_not_found</string> </key> + <value> <string>Input is required but no input given.</string> </value> + </item> + <item> + <key> <string>too_long</string> </key> + <value> <string>Too much input was given.</string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>overrides</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_maxwidth</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_width</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_maxwidth</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_width</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_maxwidth</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_width</string> </key> + <value> <int>20</int> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>input_type</string> </key> + <value> <string>text</string> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Type</string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <int>0</int> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ExpenseRecord_viewAsJio/my_type_title.xml b/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ExpenseRecord_viewAsJio/my_type_title.xml new file mode 100644 index 0000000000000000000000000000000000000000..3c046546e50dd6abf12b26ee14cbb43cbd9a7b80 --- /dev/null +++ b/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ExpenseRecord_viewAsJio/my_type_title.xml @@ -0,0 +1,272 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="StringField" module="Products.Formulator.StandardFields"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>my_type_title</string> </value> + </item> + <item> + <key> <string>message_values</string> </key> + <value> + <dictionary> + <item> + <key> <string>external_validator_failed</string> </key> + <value> <string>The input failed the external validator.</string> </value> + </item> + <item> + <key> <string>required_not_found</string> </key> + <value> <string>Input is required but no input given.</string> </value> + </item> + <item> + <key> <string>too_long</string> </key> + <value> <string>Too much input was given.</string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>overrides</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_maxwidth</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_width</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>input_type</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_maxwidth</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_width</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>input_type</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>default</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_maxwidth</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>display_width</string> </key> + <value> <int>20</int> </value> + </item> + <item> + <key> <string>editable</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>enabled</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>external_validator</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>extra</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>input_type</string> </key> + <value> <string>text</string> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Type title</string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <int>0</int> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ExpenseValidationRequest_createRepresentativeRecord.py b/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ExpenseValidationRequest_createRepresentativeRecord.py index 2be259a60598058d48291afb7ad87530c089c893..931405a435c9e65b91cc37f90e2e4a949a74da74 100644 --- a/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ExpenseValidationRequest_createRepresentativeRecord.py +++ b/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ExpenseValidationRequest_createRepresentativeRecord.py @@ -28,6 +28,8 @@ new_record.edit( comment=context.getDescription(), latitude=context.getLatitude(), longitude=context.getLongitude(), + type=context.getResource(), + type_title=context.getResourceTitle(), ) new_record.setPhotoData(None) diff --git a/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ExpenseValidationRequest_getRelatedExpenseProofUrl.py b/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ExpenseValidationRequest_getRelatedExpenseProofUrl.py new file mode 100644 index 0000000000000000000000000000000000000000..51a6c85374fc6115cf6411679deda6ba858b6fc7 --- /dev/null +++ b/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ExpenseValidationRequest_getRelatedExpenseProofUrl.py @@ -0,0 +1,16 @@ +portal = context.getPortalObject() + +publication_section = portal.ERP5Site_getPreferredExpenseDocumentPublicationSectionValue() + +proof_list = portal.portal_catalog( + strict_follow_up_uid=context.getUid(), + publication_section_uid=publication_section.getUid(), + validation_state="shared", + limit=1, + select_list=["relative_url"] + ) + +if not proof_list: + return "" + +return "/".join([portal.absolute_url(), proof_list[0].relative_url]) diff --git a/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ExpenseValidationRequest_getRelatedExpenseProofUrl.xml b/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ExpenseValidationRequest_getRelatedExpenseProofUrl.xml new file mode 100644 index 0000000000000000000000000000000000000000..d85a1048417722eddb4a1ccadafbab8cf40890fa --- /dev/null +++ b/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ExpenseValidationRequest_getRelatedExpenseProofUrl.xml @@ -0,0 +1,62 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>Script_magic</string> </key> + <value> <int>3</int> </value> + </item> + <item> + <key> <string>_bind_names</string> </key> + <value> + <object> + <klass> + <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/> + </klass> + <tuple/> + <state> + <dictionary> + <item> + <key> <string>_asgns</string> </key> + <value> + <dictionary> + <item> + <key> <string>name_container</string> </key> + <value> <string>container</string> </value> + </item> + <item> + <key> <string>name_context</string> </key> + <value> <string>context</string> </value> + </item> + <item> + <key> <string>name_m_self</string> </key> + <value> <string>script</string> </value> + </item> + <item> + <key> <string>name_subpath</string> </key> + <value> <string>traverse_subpath</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>_params</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>ExpenseValidationRequest_getRelatedExpenseProofUrl</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ExpenseValidationRequest_view/your_image.xml b/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ExpenseValidationRequest_view/your_image.xml index b7c21c0e0f101a098bc3050f557fde7c09b62e6e..32451f286267dfa6214f44bc1a91de1290ebcb13 100644 --- a/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ExpenseValidationRequest_view/your_image.xml +++ b/bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ExpenseValidationRequest_view/your_image.xml @@ -301,7 +301,7 @@ <key> <string>_text</string> </key> <value> <string encoding="cdata"><![CDATA[ -python:\'<img src="%s">\' % here.getPhotoData() +python:\'<a href="%(image_url)s"><img src="%(image_url)s?display=large"></a>\' % {\'image_url\': here.ExpenseValidationRequest_getRelatedExpenseProofUrl()} ]]></string> </value> </item> diff --git a/bt5/erp5_travel_expense/bt/template_action_path_list b/bt5/erp5_travel_expense/bt/template_action_path_list index 054853416ccdc8f6a1c04a798092d65c9a950c8c..a2bc47e2f7191fd89db485002cdc107e8deaff87 100644 --- a/bt5/erp5_travel_expense/bt/template_action_path_list +++ b/bt5/erp5_travel_expense/bt/template_action_path_list @@ -9,6 +9,8 @@ Expense Validation Request | view Leave Request Record | jio_view Leave Request Record | view Record Module | view +Service | jio_view +System Preference | hr_preference Travel Request Module | view Travel Request Record | jio_view Travel Request Record | view diff --git a/bt5/erp5_travel_expense/bt/template_keep_path_list b/bt5/erp5_travel_expense/bt/template_keep_path_list new file mode 100644 index 0000000000000000000000000000000000000000..bb1a54dcd4da58e89bb3ce1e3b6be6ee7106d7f2 --- /dev/null +++ b/bt5/erp5_travel_expense/bt/template_keep_path_list @@ -0,0 +1,2 @@ +portal_categories/publication_section/administration +portal_categories/publication_section/administration/expense \ No newline at end of file diff --git a/bt5/erp5_travel_expense/bt/template_path_list b/bt5/erp5_travel_expense/bt/template_path_list index 119eccca50900d869535a875018c447cf6a70aa3..ca2d98278f1f45f9c5bb772a6183c62757ee1c8f 100644 --- a/bt5/erp5_travel_expense/bt/template_path_list +++ b/bt5/erp5_travel_expense/bt/template_path_list @@ -1,4 +1,6 @@ portal_alarms/alarm_process_draft_record_list +portal_categories/use/hr +portal_categories/use/hr/** web_page_module/gadget_hr_* web_site_module/officejs_hr web_site_module/officejs_hr/** \ No newline at end of file