+++ /dev/null
-if (typeof(_T) == 'undefined') { _T={};}
-_T["cf72aae865f3f0be736987f7dc390e25"]="Error";
-_T["c4eac334a309182656c84b3c69d6337b"]="You are Logged in as <b>{0} ({1})</b>";
-_T["0902cdfae7b5ebaa525d4dd4fc121adb"]="Change Password";
-_T["ae2d276741dbe18ea7d82cf45e690b71"]="Add New Item";
-_T["5359af676f739607431a729778549fdd"]="Logout";
-_T["695b0048e081cdd0c1905fde237462bc"]="Closing this window will loose changes, are you sure you want to do that?";
-_T["b5f19c6de6e6bde8526a37c2a842e149"]="Loading Document details";
-_T["852039f0b664305547a9ce2768a131a4"]="invalid in_out";
-_T["9541c362ba7c5444620fc19601a3372d"]="Select at least one Row to delete";
-_T["cd4b091c7fe3281497a3b47dfb18e9d9"]="Confirm";
-_T["d062a6fe1b74c46d5384e0e4595db834"]="Are you sure you want to delete that?";
-_T["02e3cddd44d16389541b6aeb8c790ecc"]="Deleting";
-_T["e84cbf769d01c3cf5f2470839353035a"]="Error Deleting";
-_T["3fdc18a65a1b517a5009529425c3565b"]="Please Correct all the errors in red";
-_T["6ba73887c9a59d4caa85658209534ee8"]="Problem Connecting to Server - please try again.";
-_T["7aabc9f3cf1f6785a4bc4dd0f1a2a321"]="Saving failed = fix errors and try again";
-_T["b636c0e59d884e880fb4ca5fda048cf4"]="Error loading details";
-_T["7b085783b608ea949c9fb9de84016b78"]="Error Sending";
-_T["fdf760f049c0a779ad7e88cca6dc642d"]="Connection timed out sending";
-_T["584ad7a39665abc10933dac2838302f9"]="Error download";
-_T["4177e7e2dbe28af7f72338aaeb603afd"]="Problem Loading Data";
-_T["afaa6ac88a5c532720f81ab8d1cf345d"]=" (clean up) ";
-_T["1c34c8962b28be597267aef253b4694b"]="Please wait...";
-_T["6a4a6d2119244f74b8d02f20ef005c5e"]="Building Interface...";
-_T["51ff98c417d79325f91861af9c61cfb3"]="Building Interface ";
-_T["da27970c3ea08e35a23fb956908b78f4"]=" of ";
-
-_T["daed45fe377199115ee46b87eb340dcc"]="Edit Companies";
-_T["e35c34d957d7aebd0c9e37aa77f50b70"]="Cancel";
-_T["59c001255d821a2e12e8fb705dba9fea"]="Save";
-_T["5f679f3c301a24b3f538a9766ee3ae6e"]="Loading";
-_T["1f0d43f377b93713beb48cbaca0e4401"]="Your Company Details";
-_T["4cf24f0f74944b39fd350182d5e15817"]="Edit Company";
-_T["ce9ba64bb3f29723e000efb2e80abb8e"]="Add Company";
-_T["650deecbb5e829066db9b03be1125a1c"]="Consultant";
-_T["59bfcea58d8c79f4a8cc2ce8256a167a"]="Client";
-_T["692e49978c615ffee8b37ed3a8ef2a12"]="Contractor";
-_T["e3aa17d446c7005272762934b3b1e1a0"]="OWNER";
-_T["3fbd4316b2e824257633036893085545"]="System Owner";
-_T["857adf078513b5f11f815595aa0f9fd1"]="Company ID (for filing Ref.)";
-_T["75d069b37c5159f5acb5d01d10a2d9a3"]="Enter code";
-_T["81cbd120755795f72b127151e540cde5"]="Select Type";
-_T["37b6f9357707805a4612ebc166766ee2"]="Company Name";
-_T["d0845cdf23eb01488ec78802847e0273"]="Enter Company Name";
-_T["f111792776dd00af4e9575dffce62c41"]="Phone";
-_T["7512ebcca5961d7894b501b6b0556c36"]="Enter Phone Number";
-_T["5595a13ebb30e328ffb5b6def210a94c"]="fax";
-_T["73fe964a2d78700ea90ec792a87cb425"]="Enter fax Number";
-_T["4e3ed651f76a84604309db4a263b8e44"]="Email";
-_T["5caf4f1f1ea765a217064568800b9eee"]="Enter Email Address";
-_T["7688941a47dfb4d4edaaf460f81d69ab"]="Address";
-_T["bcde687f68818bdff785998f3f4b4dcc"]="Enter Address";
-_T["7931e6a8fdc03aeb23619c11057cfb46"]="Remarks";
-_T["978731b3f7cb08990f958c25b4cc9702"]="Enter remarks";
-_T["4c63cd35411e0bfe84d30f523cf6b93a"]="Background Colour";
-_T["9c24ec3378fb01fb54d25c2075d3293d"]="Logo Image";
-_T["31e77d71bd68053a7d6fcd4bc974af6a"]="No Image Attached";
-_T["8ffc3bf05859510e6dc4613b607cdcbe"]="Change / Add Image";
-_T["0e671bf5ff1cf6b299f895f78678121b"]="No Image Available";
-_T["490679f6791d65bc9998cadb629c7053"]="Add / Change Image";
-_T["f5978f4e5815e0516744069dd287e5d9"]="Upload Image";
-
-_T["9566c872f5eb3606aff77e92ef404f6f"]="Edit Document Type";
-_T["918b8aa8008529245b10c94d04e201c6"]="Cancel";
-_T["7b0411b72ad383c3e2260d2293b0e2f7"]="Save";
-_T["3856b4848e0006d06445a3ec0026e6b9"]="Code";
-_T["ba960e685bbb3f9c913365a52e998454"]="Enter code";
-_T["04c4d9039b04ae1bb4143edcd3310cc3"]="Document Type";
-_T["16fdbf7788088cd5e4251adddf31957e"]="Enter Document Type";
-_T["ff98eddf5a2bfb7ab13af0efe685783b"]="Remarks";
-_T["cfa368a58af37baf0ff74f80a9d7f192"]="Enter remarks";
-
-_T["180ab418d1431a5e3ab16412df46995c"]="Upload Image or File";
-_T["584228d91d54c791da0c7b9f60eb0568"]="Cancel";
-_T["e7cf748ba346b55abdcc4b23eee865f2"]="Save";
-_T["f63d2ff3c0824d9a6d914b023170a0e7"]="Error";
-_T["de7fa9da20484d1ee51e3e11385b106a"]="Saving failed = fix errors and try again";
-_T["6bb7047abac30e5f215a55ee1258d63e"]="Error loading details";
-_T["6644290819b3cd82cd7a447b4f9082d9"]="Upload Image or File";
-_T["7e627bc5cadbc3aa73653b2e65eebf41"]="Sending";
-_T["3b504c4d3b791c1aa278926f21482646"]="Uploading";
-
-_T["7836ab6fe8fe6f6ec502b3108a13e21d"]="Edit Office / Department / Sub Company";
-_T["1832ff6f8f4dc04e11d8da18197bd04e"]="Cancel";
-_T["09216d718e93d47e7fab400386e0e666"]="Save";
-_T["b41c4b23e06e87f60c5cb0bd5bf4de81"]="Company";
-_T["526fafd56ab833df1f4ffd447600a9d1"]="Office / Department / Sub Comp. Name";
-_T["69424c2ba40b27522c5f582fbe4b754b"]="Enter name";
-_T["1576472bc936da286e17816117c69800"]="Address";
-_T["c8805cab313fc29f3642f9a5c7f9aa64"]="Enter address";
-_T["e726c3820bd60bc1c312fb8c51dc3642"]="Phone";
-_T["085c2f603ebade12c9f292ef40fd6b07"]="Enter phone";
-_T["85a92c56516f8b4fb28cef275e39aa59"]="fax";
-_T["4e53f9de03e95a51293bbd4c2518cc7d"]="Enter fax";
-_T["55d8a63eb4ad34aaf8a64e677a7ba02e"]="Email";
-_T["20c803184f4250311d36b34678a81e99"]="Enter email";
-
-_T["bc619e5bc0e08070f5aea669b1afdba1"]="Edit Contact Details";
-
-_T["c5f95205dd78ae006d052009aa6142f8"]="Send Introduction Mail";
-_T["687a326482448749613f378d040f6ef6"]="Cancel";
-_T["7033b8924378a2098ecf784128d96125"]="Save";
-_T["98ca94191386d0d2cd58bd272d1df5d7"]="Sending Welcome Message";
-_T["92e1985e19c2bb5d9556ac7ba52d5a7a"]="Company";
-_T["276038b1ea02816633ab56c087ab5e8b"]="Select Company";
-_T["4b59409465457ad433c029640bf1a2c5"]="Searching...";
-_T["be407624d99fa1d3edd7ff59c079dd62"]="Office";
-_T["b41f06c5d4aa97be01660b5033f3c0b9"]="Office / Department";
-_T["99667c31cbee3c1649a9abfba6f76f5f"]="Select Office";
-_T["7825faf6d798725b4f9c36122dc0d78f"]="Error";
-_T["e81e0305bf7b9c0bff38b1bd4113a94b"]="Select An Company First";
-_T["43a33d905d2c47dcd5afccb8d6c5c9ec"]="Contact Name";
-_T["801f9098abec829acfaad24d9c38acf1"]="Enter name";
-_T["976cb754f8a3120a0d8ddecc7dad70b3"]="Role / Position";
-_T["36e08fc5b447ea57d5f9801a0a594de8"]="Enter Role / Position";
-_T["8ecda72b47a4d87945396f1deb3a4e2b"]="Phone";
-_T["60c2576c3bd6fce9593dfafa60d5dc71"]="Enter phone Number";
-_T["6eab94585302a1eb047d8ad46a822fe1"]="Fax";
-_T["bbc9b7422ae486331486a0734c399109"]="Enter fax";
-_T["fef6c4502e830f3cb17ceda089079d08"]="Email";
-_T["b9b189c9b68fd2072e2937f60042e970"]="Enter email";
-_T["598d3e15de6c0edc42bbb12bba56848c"]="Email address (one per line)";
-_T["56270c6137713c24a973c4239ef10a8c"]="Enter email addresse";
-_T["024116eeefc851698f4381072c88c988"]="New Password ";
-_T["9ea81314e83737179ff499c00215e349"]="Password (type again to confirm)";
-_T["28d4e53cb89a8406eaacfece36ecfbea"]="Always File Messages from this Person in Project";
-_T["b5506f1d5c8fcd78b22b830ce30a377f"]="Project";
-_T["fac109c69eeb67ebda3c5e40393bcb9b"]="Action Type";
-_T["82c0f8b8dd0cb58b397ee9d6f633749e"]="Action Required";
-_T["035ee8612761bb1546093a1b22451b67"]="Yes";
-_T["4545094571d2bd9ce3dfc20783cf3dbc"]="No";
-_T["4e8097f84abcc6d92ca69656d0e94024"]="Select a Company";
-_T["3a2644a946cf95a21e5890507232305f"]="You must create a password to send introduction mail";
-_T["c9f36f7b1c27b424e71ce6c66a2f000e"]="You must create a password for the admin account";
-_T["f202ec7143eb64a7694663d5d795972b"]="Passwords do not match";
-_T["b57f7c3a947d7a7a24dcce08a1f789ec"]="Sending";
-_T["ecb6cc539899477d30b822eab4f51b57"]="Loading";
-_T["6c755092c6556392d8f8589ea57ed32e"]="Select the Company Name";
-_T["f81f0fdf4c6384f98a5d1f49ffd0ebe3"]="Send Welcome";
-_T["0734055957ed2deb78318855e001f072"]="Send Welcome Messages and Generate Passwords?";
-_T["2b80fb0dc406c89322d30ed0c0f6150b"]="\\n";
-_T["453b606630064afeccae473d15cb21f1"]="No addresses found";
-_T["ffe42f94e27e5228d3d2320e16dfb61b"]="Creating Account / Sending Welcome";
-_T["d4efe6bd99e2f9dca237692425cd1e37"]="Please wait...";
-_T["78800f89af27b724063900f2ac603ea8"]="Done";
-_T["4f53be722b07293542247cc405232a69"]="Done - ";
-_T["b3d5fbd734ec40cdb88c7e544b737e57"]=" : ";
-
-_T["3e8788f13c62d5400e2eef9ce61ff6d6"]="Edit Contact Details";
-
-_T["aacd89f134545118f60a671de60913d3"]="New Contact Details";
-
-_T["386f61f04d35fedb1ab564f275a0cc37"]="Add / Edit Staff";
-
-_T["59222ad07bc6410bf27eab7d035b409d"]="Edit Project";
-_T["0e8ccf88135bae007b5cff5837e3e197"]="Cancel";
-_T["d825914fad6e57c9d1acac55bc74f464"]="Save";
-_T["f1a3e388543d7a8d39f1a3d4ade58b94"]="Code";
-_T["9384bc850b628f21d964769bd7d13e44"]="Enter Project Code";
-_T["2e6569fe7187cf7b776eebf79012c19c"]="Project Name";
-_T["be3b8a3bb525b99922adf15223852b6a"]="Enter Project Name";
-_T["7ca882603340513c5a17a92e2ba98140"]="Project type";
-_T["ff40386a43ccfe9066f7ebe51992cd86"]="Client";
-_T["720eb6ec8a30c82c92847a11ee6d32e6"]="Select Client";
-_T["4a17dd69fb7066cf43bf7c5f3d9e4cc6"]="Searching...";
-_T["0699fc5c5d74dce96c828c6e578ece63"]="Team";
-_T["45e0394905808bcc80c34202748ddb13"]="Select Team";
-_T["b72ffe66d7fb5278bc886ee23dbda9fa"]="File Location";
-_T["4206f45d33f6d7d12e9e7b6efc86e0de"]="Where are the files stored?";
-_T["59242789e33d13385e7775bc7421464e"]="Remarks";
-_T["0ebe06a05911b24af87a933ca81882a0"]="Enter Project Remarks";
-_T["00f5ccf184f1ff533931bde4424040b2"]="Date";
-_T["b90aa2ba8fe6d79a85c11ef4034f1f86"]="Enter Date Opened";
-_T["c2257f446d410ea7a44b2f3fd68baa4a"]="By";
-_T["5fcc9c08873869529a4c0f640c34b803"]="Select Person Who opened";
-_T["0f67962c957fe1a78b2abbcdd1959fab"]="Project (Unconfirmed)";
-_T["885cfd841387dbb74b3b05d5ab44ac3c"]="Project";
-_T["fb3df23fb6c604eb3f9f5a6195be8b08"]="Project (Closed)";
-_T["e51c6929125db77ad4bc99165f315a54"]="Non-Project";
-_T["de3791961a26ccaef609480733d9e29e"]="Non-Project (Closed)";
-
-_T["c1d17a6224927a2a9fedfe19d7a211c3"]="Country";
-_T["a11dac8be1a6f587eedf4a1c1e2699ae"]="Select Country";
-_T["9bc63702145bdb09708fa539aeefd725"]="Language";
-_T["abbb23b334572407b19d843b3dfa3ee5"]="Select Language";
-_T["1715e2ee8fbb45f3bb264d9806719b71"]="Currency";
-_T["09e12895bf6d4b9974098883faa51a0b"]="Select Currency";
-_T["9cdc0fbfc6a23315187fe5cea6cd9c59"]="Language(s)";
-_T["3b073f6f35aed6785dbccdf6ea9ecd13"]="Select a language to add.";
-_T["0202dbdb1d198fc99ff5e6a12dc1d1ff"]="Searching...";
-_T["4e58ecc198012e7ff1b9c77d4617498f"]="Country(s)";
-_T["b9cd67022614720c2f168ce18ab32b1c"]="Select a country to add.";
-
-_T["8391d964e04c0c30d9f19bf036136c8d"]="Error";
-_T["4b0bb0bd607983ab0061a86db7fc7ba2"]="Error getting authentication status. - try reloading, or wait a while";
-_T["54242987801741c4105cfa0435d9912e"]="Error getting authentication status. - try reloading";
-_T["9eba57f4ad82997225a340c5c140a869"]="Warning";
-_T["5d5717e963d28007da9511d1416cbc43"]="This is an open system - please set up a admin user with a password.";
-_T["68156a5e398303b805bd96fbc6b1f8ee"]="Login";
-_T["b2d0ea65f8ae06179a40d78e52b7833c"]="Forgot Password";
-_T["9055d707d0388278ceb4f35426316c1b"]="Fill in your email address";
-_T["2409934e0552cdd76753d2c11005b6b5"]="Problem Requesting Password Reset";
-_T["463c573d3aed3795e9e3145f10cd1416"]="Notice";
-_T["de7b06c26e8b5361eb8e33d068dd2ce4"]="Please check you email for the Password Reset message";
-_T["31cfba7708e9535c79660355d0f8accf"]="Logging in";
-_T["c1b8242e54c06ad890a6a091195f7b8e"]="Login failed - communication error - try again.";
-_T["7e698d4c146d9eefd5dcd10552b18098"]="Email Address";
-_T["23e3b3bf16c1b9ee0b448a20cde1d8a0"]="input";
-_T["356c052df252f5f41bf445742c4a9e92"]="text";
-_T["e5c7255d15759b64bbee6c623c299744"]="20";
-_T["3b9a78188b115fa00e2285cd1047a02e"]="Password";
-_T["b2a3486b5105e365dae1a1796390ba42"]="Language";
-_T["b9f8e134e8143020e2eb596292c7c1d1"]="Error logging out. - continuing anyway.";
-_T["20f52c7354a3fd19843e600c53121d94"]="Sorry";
-_T["1ba0950dff36aebd0c55f3b195edcb11"]="Language not available yet (";
-
-_T["eadd75daa6471a87eb75121dd5eab06a"]="Change Password";
-_T["9b6839c225da5cb93c3bf29720e0531d"]="Cancel";
-_T["f7c61a97b669d7f5128b51c8644c400c"]="Save";
-_T["db88368227b739ed12b165005f43d2c9"]="Error";
-_T["23b47796783d663d3113bde8469f9202"]="Please Correct all the errors";
-_T["25092a9a028d282401e526d9252c734d"]="Saving failed = fix errors and try again";
-_T["39b3f1da7208ad35ea991d47bb460b30"]="Error loading details";
-_T["1b6ed9a99ae0f49a874fab476d0e70c4"]="New Password ";
-_T["6f52a45578b8376c688a75ddc7888122"]="New Password (type again to confirm)";
-_T["78a7430d961bec5b3d4759206ebc2b04"]="Enter Passwords in both boxes";
-_T["a217bd43e7427e981bc8dbf18998faed"]="Passwords do not match";
-
-_T["e4fe205ae80b87b90434e12e5e3a4c9b"]="Click to view PDF";
-
-_T["e82288f1b4eba83e3912993b59e9874c"]="Project";
-_T["8e24b2c00ecb83fdbedee6634dbe7a6e"]="Select Project";
-_T["dacaeb74293d8e9bb58c28681b02c321"]="Searching...";
-_T["993475eb7faf2229459aa6ca1c3745e9"]="Sent To";
-_T["f7e6a2016c5b5f0113b18708d84db782"]="Enter Sent To";
-_T["adaa177b337c92793900a09979b7644f"]="Type";
-_T["f3ae3d381d60864b13244e2ac16c12fe"]="Select Document Type";
-_T["f6551e5409cd0bd1293c73466c0d5a71"]="To";
-_T["397925800f038e68f28adacc0c39d6ca"]="Select an address to add.";
-_T["964610e35dbc2d5e2ef34f1492eff1c7"]="Office / Department";
-_T["2b617d7e2e8fdfe8fee08f5086f6e7b7"]="Select Office";
-
-_T["45e376f384cdb1f67a866700b892b3e8"]="Name";
-_T["d5cd30d9a8889de9ad91d34e09da494b"]="Not in a Group";
-_T["8b2b7b9a1be82d2550e1d2bf71504f40"]="All Staff (Default Permissions)";
-_T["0534e1944a96427d47b562c494d85447"]="Everybody";
-_T["0b0e4ee0b6875cbaa307a8d7f3c3d7ee"]="All Staff";
-_T["b9b270f938cabca10640a932c830a4ce"]="Adminstrators";
-_T["982d7a1e24433e552a3d694a095f053e"]="Manage Groups";
-_T["0f65f59038860dbf03201afab99fe7e1"]="Add";
-_T["0537a153a0e54447d83d2c8d094a03d1"]="Edit";
-_T["081fcfe0460716e500eeab497d45d6b8"]="Error";
-_T["f845801a4be23199251c41e1c2ac5e98"]="Select only one Row";
-_T["178044591ed0652d2b82b7f7eb90b22a"]="Select a Row";
-_T["075c26b58d3827f7726bb1eb7c2d13dc"]="You can not rename that group";
-_T["1eeb327bd294d207da46d9cfb93f9042"]="Delete";
-_T["2d481b48a578e9122e0cda91604a73b1"]="You can not delete that group";
-_T["726e57af6b8966adfdcaa385105de4d1"]="Reload";
-
-_T["25310235b726d71d9d0bc2fc903b9a3b"]="Staff";
-_T["4788be05034a6a24e08add98ed12fddf"]="Displaying ";
-_T["0a1ea6b8f312884c024a49ea271b6330"]=" {0} - {1} of {2}";
-_T["f405b2cca36f62eb81fa563a0b7406ac"]="No ";
-_T["7bca1e8820519d2993ebabfa434007c9"]=" found";
-_T["469845eeeb8c7f2983a5fc6550af4dc7"]="Drag person to add or remove from group";
-_T["d559132c96908612dd66163dbd532812"]="Drag person to add or remove from team";
-_T["40c16e64d6bf564aa75d2287d06c9a7b"]="Show old staff";
-_T["2bcbf24c822c1428b849349709d432b4"]="Hide old staff";
-_T["39c8bb31d465dfc147324be427ace5e9"]="Add";
-_T["a89b59994ae0fe49d108d3e22d68a8f3"]="Bulk Add";
-_T["d1ff8ffcb0bc971614aef7c0b5a07290"]="Edit";
-_T["bf5c8b4410513986dffc6d6d6f025c5f"]="Error";
-_T["8d7a86f0b9a3f7f52e7b49206b42f1ff"]="Select only one Row";
-_T["f8eeb7a5fd0bed49c85e3664518a5e7c"]="Select a Row";
-_T["022426919cf2c4cb91db4d37dbe5d24c"]="Toogle Active";
-_T["ecb1973f7aa6a900a49efa65dfc18da4"]="Select People Row";
-_T["0c87cd7a6911dfa20a87e9073a4891f0"]="Sending";
-_T["864c4e5c64245516e1fcdabaf49b8de1"]="Error Sending";
-_T["1984cf10277dee6c3ff92d27c3b05493"]="Delete";
-_T["f128b31c31b3754f5792d2eefdca21d0"]="Search";
-_T["87472631093f63c722db73519eb9e4b9"]="Reset Search";
-_T["4d49b66bbfd392f5307e93c277054732"]="Project";
-_T["aacd489f97738135f87d1c85be64536b"]="Name";
-_T["bd87244321a326daa26695ab4b721c7c"]="Company Type";
-_T["60c647263578176b102261a5ae1004a6"]="Company / Office";
-_T["3bb13cf053c9459ba5f2bad62a2e208b"]="Office / Dept.";
-_T["118585dae50b38d2079b28afa5d768d6"]="Role / Position";
-_T["0bfc17408bdeecfce4652e09c3b90621"]="Phone";
-_T["1ee4e8e2d1859ff63a7b58f29505249f"]="Fax";
-_T["42fcc3face9df26268d1c2bf30dcd747"]="Email";
-_T["54bf9f5699148960b91086f351cf159e"]="Active";
-
-
-
-
-
-
-if (typeof(_T) == 'undefined') { _T={};}
-
-
-
-
-
-Pman = new Roo.Document(
-{
-
- subMenuItems : [],
- topMenuItems : [],
- rightNames: { },
- buildCompleted : false,
- events : {
- 'beforeload' : true,
- 'load' : true,
- 'authrefreshed' : true
- },
-
- listeners : {
- 'ready' : function()
- {
-
- if (typeof(console) == 'undefined') {
- console = { log : function() { } };
- }
-
-
- if (Ext.get('loading')) {
- Ext.get('loading').remove();
- }
-
-
- Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
-
-
-
- if (AppLinkError.length) {
- Ext.MessageBox.alert(_T["cf72aae865f3f0be736987f7dc390e25"], AppLinkError, function() {
- Pman.Login.onLoad();
- });
- return;
- }
-
-
-
- if (showNewPass.length) {
- Pman.PasswordChange.show( { passwordReset : showNewPass },
- function(A) {
-
- Pman.Login.onLoad();
- }
- );
- return;
- }
-
-
- Pman.Login.onLoad();
-
- },
- 'load' : function()
- {
- if (Roo.get('loading-logo-tile')) {
- Roo.get('loading-logo-tile').remove();
- }
- if (Roo.get('loading-logo-tile-top')) {
- Roo.get('loading-logo-tile-top').remove();
- }
- if (Roo.get('loading-logo-bottom')) {
- Roo.get('loading-logo-bottom').remove();
- }
- if (Roo.get('loading-logo-center')) {
- Roo.get('loading-logo-center').remove();
- }
- }
-
- },
-
-
-
- layout: false,
-
- onload: function() {
-
-
-
-
- if (this.layout) {
- return;
- }
- if (Ext.get('loading')) {
- Ext.get('loading').remove();
- }
- if (Ext.get('loading-mask')) {
- Ext.get('loading-mask').show();
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var A = this;
- this.stime = new Date();
- this.layout = new Ext.BorderLayout(document.body, {
- north: {
- split:false,
- initialSize: 25,
- titlebar: false
- },
-
-
- center: {
- titlebar: false,
- autoScroll:false,
- closeOnTab: true,
- tabPosition: 'top',
-
- alwaysShowTabs: true,
- minTabWidth: 140
- }
-
- });
-
- this.fireEvent('beforeload',this);
-
-
-
- this.layout.beginUpdate();
- this.layout.add('north', new Ext.ContentPanel('title', 'North'));
- var au = Pman.Login.authUser;
- if (au.id > 0 && au.company_id_background_color.length) {
- Ext.get('title').dom.style.backgroundColor = '#' + au.company_id_background_color;
- Ext.get('headerInformation').dom.style.color = this.invertColor('#' + au.company_id_background_color);
- }
- if (au.id > 0 && au.company_id_logo_id * 1 > 0) {
- Ext.get('headerInformation-company-logo').dom.src = baseURL +
- '/Images/' + au.company_id_logo_id + '/' + au.company_id_logo_id_filename;
- } else {
- Ext.get('headerInformation-company-logo').dom.src = Roo.BLANK_IMAGE_URL;
- }
-
-
- Ext.get('headerInformation').dom.innerHTML = String.format(
- _T["c4eac334a309182656c84b3c69d6337b"],
- au.name, au.email, au.company_id_name,
- AppVersion , appNameShort
- );
-
-
- document.title = appName + ' v' + AppVersion + ' - ' + au.company_id_name;
- Ext.QuickTips.init();
- if (Ext.isGecko) {
- Ext.useShims = true;
- }
-
-
-
-
- this.layout.beginUpdate();
-
- Pman.building = true;
-
- this.buildModules(this,
- function() {
-
- A.layout.getRegion('center').showPanel(0);
- A.layout.endUpdate();
- A.addTopToolbar();
- A.finalize();
- A.fireEvent('load',this);
- }
- );
-
-
-
- },
-
- addTopToolbar : function()
- {
-
-
-
-
-
-
- var se = Pman.layout.getRegion('center').tabs.stripEl;
- var B = se.createChild(
- { tag: 'td', style: 'width:100%;' });
-
- var C = new Ext.Toolbar(B);
-
- if (Roo.isSafari) {
- var tbl = se.child('table', true);
- tbl.setAttribute('width', '100%');
- }
-
- C.add(
- new Ext.Toolbar.Fill(),
-
- {
- text: _T["0902cdfae7b5ebaa525d4dd4fc121adb"],
- cls: 'x-btn-text-icon',
- icon: rootURL + '/Pman/templates/images/change-password.gif',
- handler : function(){
- Pman.PasswordChange.show({});
- }
- }, '-'
- );
-
-
- if (this.topMenuItems.length) {
-
- Roo.each(this.topMenuItems, function (mi) {
- C.add(mi);
- });
- C.add('-');
- }
-
-
-
- if (this.subMenuItems.length) {
-
- this.subMenuItems.sort(function (a,b) {
- return a.seqid > b.seqid ? 1 : -1;
- });
-
-
- this.subMenuItems.pop();
-
- C.add(
- {
-
- text: _T["ae2d276741dbe18ea7d82cf45e690b71"],
- cls: 'x-btn-text-icon',
- icon: Ext.rootURL + 'images/default/dd/drop-add.gif',
- menu : {
- items : this.subMenuItems
- }
- } ,'-'
- );
- }
-
-
- C.add(
- {
- text: _T["5359af676f739607431a729778549fdd"],
- cls: 'x-btn-text-icon',
- icon: rootURL + '/Pman/templates/images/logout.gif',
- handler: function() {
- Pman.Login.logout();
- }
-
- }
- );
-
-
- },
-
-
- finalize : function() {
-
-
-
- window.onbeforeunload = function(e) {
- var e = e || window.event;
- var r = _T["695b0048e081cdd0c1905fde237462bc"];
-
-
- if (e) {
- e.returnValue = r;
- }
-
-
- return r;
-
- };
-
- Ext.MessageBox.hide();
- if (Ext.get('loading-mask')) {
- Ext.get('loading-mask').remove();
- }
-
-
-
- this.buildCompleted = true;
-
-
-
- if (AppTrackOnLoad * 1 > 0) {
- this.onLoadTrack(AppTrackOnLoad,false);
- }
-
-
-
- var D = function(F)
- {
- if (!F || !F.id) {
- Pman.Dialog.PersonStaff.show(
- {
- id : 0,
- company_id : Pman.Login.authUser.company_id * 1,
- company_id_name : Pman.Login.authUser.company_id_name
- }, function(G) {
- D(G);
- }
- );
- return;
- }
-
- Ext.state.Manager.set('Pman.Login.username', F.email),
- window.onbeforeunload = false;
- document.location = baseURL + '?ts=' + Math.random();
- };
-
- var E = function(F) {
- if (Pman.Login.authUser.company_id * 1 > 0) {
- D();
- return;
- }
- if (!F || !F.id) {
- Pman.Dialog.Companies.show( { id : 0, isOwner : 1, comptype: 'OWNER' }, function(G) {
- E(G);
- });
- return;
- }
-
- Pman.Login.authUser.company_id = F.id;
- Pman.Login.authUser.company_id_name = F.name;
- D();
- };
-
- if (Pman.Login.authUser.id < 0) {
- E();
-
-
-
- }
-
-
- },
-
-
-
-
-
- onLoadTrack : function(id,cb) {
- this.onLoadTrackCall(id, cb, 'DocumentsCirc_');
- },
- onLoadTrackEdit : function(id,cb) {
- this.onLoadTrackCall(id, cb, 'Documents_');
- },
-
-
-
-
-
- onLoadTrackCall : function(id,cb, F) {
- Ext.get(document.body).mask(_T["b5f19c6de6e6bde8526a37c2a842e149"]);
-
- Pman.request({
- url: baseURL + '/Roo/Documents.html',
- params: {
- _id: id
- },
- method: 'GET',
- success : function(G) {
- Ext.get(document.body).unmask();
-
-
- switch(G.in_out) {
- case 'IN' : F+='In';break;
- case 'OUT' : F+='Out';break;
- case 'WIP' : F+='Wip';break;
- default:
- Ext.MessageBox.alert(_T["cf72aae865f3f0be736987f7dc390e25"], _T["852039f0b664305547a9ce2768a131a4"]);
- return;
- }
-
- Pman.Dialog[F].show(G, cb ? cb : Pman.refreshActivePanel);
- },
-
- failure: function() {
- Ext.get(document.body).unmask();
-
-
-
-
- }
- });
-
- },
-
-
-
- hasPerm: function(G, H) {
- if (typeof(Pman.Login.authUser) != 'object') {
- return false;
- }
- if (typeof(Pman.Login.authUser.perms[G]) != 'string') {
- return false;
- }
- return Pman.Login.authUser.perms[G].indexOf(H) > -1;
-
- },
-
-
-
-
-
-
-
-
- Readers : {},
- ColModels : {},
- Forms : {},
- Tab : {},
- Dialog : {},
-
- processResponse : function (I)
- {
- var J = '';
- try {
- J = Ext.decode(I.responseText);
-
- if (typeof(J) != 'object') {
- J = { success : false, errorMsg : J, errors : true };
- }
- if (typeof(J.success) == 'undefined') {
- J.success = false;
- }
-
- } catch(e) {
- res = { success : false, errorMsg : response.responseText, errors : true };
- }
- return J;
- },
- genericDelete : function(K,L) {
-
- var r = [];
-
-
- var s = K.grid.getSelectionModel().getSelections();
- if (!s.length) {
- Ext.MessageBox.alert(_T["cf72aae865f3f0be736987f7dc390e25"], _T["9541c362ba7c5444620fc19601a3372d"] );
- return '';
- }
-
- for(var i = 0; i < s.length; i++) {
- r.push(s[i].data.id);
- }
-
-
- Ext.MessageBox.confirm(_T["cd4b091c7fe3281497a3b47dfb18e9d9"], _T["d062a6fe1b74c46d5384e0e4595db834"],
- function(M) {
- if (M != 'yes') {
- return;
- }
-
-
- K.grid.getView().mainWrap.mask(_T["02e3cddd44d16389541b6aeb8c790ecc"]);
- Pman.request({
- url: baseURL + '/Roo/'+L+'.php',
- method: 'GET',
- params: {
- _delete : r.join(',')
- },
- success: function(N) {
- K.grid.getView().mainWrap.unmask();
- if ( K.paging ) {
- K.paging.onClick('refresh');
- } else if (K.refresh) {
- K.refresh();
- } else if (K.grid.footer && K.grid.footer.onClick) {
-
- K.grid.footer.onClick('refresh');
- } else {
- K.grid.getDataSource().load();
- }
-
-
-
- },
- failure: function(O) {
- K.grid.getView().mainWrap.unmask();
- Ext.MessageBox.alert(_T["cf72aae865f3f0be736987f7dc390e25"], _T["e84cbf769d01c3cf5f2470839353035a"]);
- }
-
- });
- }
- );
- },
- refreshActivePanel : function() {
- var M = this.layout.getRegion('center').getActivePanel();
- if (M.controller && M.controller.paging) {
- M.controller.paging.onClick('refresh');
- return;
- }
-
- var N = Pman.layout.getRegion('center').getActivePanel().id;
- if (!N) {
- return;
- }
-
- Pman.Tab[N].paging.onClick('refresh');
- },
- toCidV : function(O) {
- return 'C' + O.in_out.substring(0,1) + O.cid;
- },
-
- standardActionFailed : function(f, P, cb) {
-
- if (P.failureType == 'client') {
- Ext.MessageBox.alert(_T["cf72aae865f3f0be736987f7dc390e25"], _T["3fdc18a65a1b517a5009529425c3565b"], cb);
- return;
- }
- if (P.failureType == 'connect') {
- Ext.MessageBox.alert(_T["cf72aae865f3f0be736987f7dc390e25"], _T["6ba73887c9a59d4caa85658209534ee8"], cb);
- return;
- }
-
- if (P.type == 'submit') {
-
- Ext.MessageBox.alert(_T["cf72aae865f3f0be736987f7dc390e25"], typeof(P.result.errorMsg) == 'string' ?
- String.format('{0}', P.result.errorMsg) :
- _T["7aabc9f3cf1f6785a4bc4dd0f1a2a321"], cb);
- return;
- }
-
-
-
- Ext.MessageBox.alert(_T["cf72aae865f3f0be736987f7dc390e25"], _T["b636c0e59d884e880fb4ca5fda048cf4"],cb);
- },
-
-
- request : function(c) {
-
- Ext.Ajax.request({
- timeout : c.timeout || 30000,
- url: c.url,
- method : c.method,
- params: c.params,
- xmlData : c.xmlData,
- success: function(Q, R) {
-
- var S = Pman.processResponse(Q);
-
- if (!S.success) {
- if (c.failure) {
- if (true === c.failure.call(this,Q, R)) {
- return;
- }
- }
-
- Roo.MessageBox.hide();
- Ext.MessageBox.alert(_T["cf72aae865f3f0be736987f7dc390e25"], S.errorMsg ? S.errorMsg : _T["7b085783b608ea949c9fb9de84016b78"]);
- return;
- }
-
-
- c.success.call(this, S.data);
-
- return;
- },
- failure : function(T, U) {
-
- if (c.failure) {
- if (true === c.failure.call(this,T, U)) {
- return;
- }
- }
-
- Roo.MessageBox.hide();
- Roo.MessageBox.alert(_T["cf72aae865f3f0be736987f7dc390e25"], _T["fdf760f049c0a779ad7e88cca6dc642d"]);
- console.log(T);
-
- },
- scope: this
-
- });
- },
- csvFrame : false,
-
- createCsvFrame: function()
- {
-
- if (this.csvFrame) {
- document.body.removeChild(this.csvFrame);
- }
-
- var id = Ext.id();
- this.csvFrame = document.createElement('iframe');
- this.csvFrame.id = id;
- this.csvFrame.name = id;
- this.csvFrame.className = 'x-hidden';
- if(Ext.isIE){
- this.csvFrame.src = Ext.SSL_SECURE_URL;
- }
-
- document.body.appendChild(this.csvFrame);
-
- if(Ext.isIE){
- document.frames[id].name = id;
- }
-
- },
-
-
-
-
- download : function(c) {
-
- if (c.newWindow) {
-
- window.open( c.url + '?' + Roo.urlEncode(c.params || {}), '_blank');
- return;
-
- }
-
-
- this.createCsvFrame();
- function cb(){
- var r = { responseText : _T["88d66c37128476736b8c2a9cd9a87917"], responseXML : null };
-
- var Q = this.csvFrame;
-
- try {
- var doc = Ext.isIE ?
- Q.contentWindow.document :
- (Q.contentDocument || window.frames[this.csvFrame.id].document);
-
- if(doc && doc.body && doc.body.innerHTML.length){
-
- Ext.MessageBox.alert(_T["584ad7a39665abc10933dac2838302f9"],doc.body.innerHTML);
- }
-
- }
- catch(e) {
- }
-
-
- Ext.EventManager.removeListener(Q, 'load', cb, this);
-
- }
-
- Ext.EventManager.on( this.csvFrame, 'load', cb, this);
- this.csvFrame.src = c.url;
- },
- downloadRevision : function(Q, R)
- {
- this.download({
- url: baseURL + '/Documents/Doc/DownloadRev/'+ Q.id + '/' + R + '/' +
- Q.project_id_code + '-' + Q.cidV + '-' + R + '-' + Q.filename
- });
-
- },
- exportCSV : function(c) {
-
- for(var i=0;i < c.csvFormat.length;i++) {
- c.params['csvCols['+i+']'] = c.csvFormat[i][0];
- c.params['csvTitles['+i+']'] = c.csvFormat[i][1];
- }
-
-
-
- c.url += '?' + Ext.urlEncode(c.params);
- this.download(c);
-
- },
- prettyDate : function (S)
- {
- if (typeof(S) == 'string') {
- var ds = Date.parseDate(S, 'Y-m-d H:i:s');
- if (ds) {
- return this.prettyDate(ds);
- }
-
- ds = Date.parseDate(S, 'Y-m-d');
- if (ds) {
- return this.prettyDate(ds);
- }
- return '';
- }
-
- if (!S) {
- return '';
- }
- var td = new Date();
- var T = Math.floor(td.getElapsed(S) / (1000 * 60*60*24));
- if (T < 7) {
- return S.dateFormat('D H:i');
- }
-
-
- if (td.dateFormat('m') == S.dateFormat('m')) {
- return S.dateFormat('dS D');
- }
-
- if (td.dateFormat('Y') == S.dateFormat('Y')) {
- return S.dateFormat('dS M');
- }
- return S.dateFormat('d M Y');
- },
- loadException : function(a,b,c,d)
- {
- if (d && d.authFailure) {
- Pman.Login.show();
- return;
- }
-
- Roo.MessageBox.alert(_T["4177e7e2dbe28af7f72338aaeb603afd"], a.message || c.statusText);
- },
-
-
-
-
-
- notifyActive : false,
-
- notifyTitle: function(U)
- {
- if (this.notifyActive ) {
- return;
- }
- var V = false;
-
- var W = function() {
- V = true;
- document.title = X;
- };
-
- Roo.get(document.body).on('mousemove', W, this);
- var X = document.title;
- var s = 1;
- var Y = this;
- var Z = window.setInterval(function() {
-
- if (V) {
- Roo.get(document.body).un('mousemove', W, this);
- Y.notifyActive = false;
- document.title = X;
- window.clearInterval(Z);
- return true;
- }
-
- s = !s;
- document.title = s ? U : X;
-
- }, 1000);
- document.title = U;
-
-
-
- },
-
- modules : false,
-
-
- register : function(g) {
- if (!g.parent) {
- if (g.parent === false) {
-
- return;
- }
-
-
- console.log(g);
- }
- if (!g.parent.modules) {
- g.parent.modules = new Roo.util.MixedCollection(false, function(o) { return o.modKey });
- }
-
-
- g.parent.modules.add(g);
-
- },
-
- buildModules : function(h, j)
- {
-
- var k = this;
- var l = function(a,b) {
- return String(a).toUpperCase() > String(b).toUpperCase() ? 1 : -1;
-
- };
- if (!h.modules) {
- return;
- }
-
- h.modules.keySort('ASC', l );
- var o = [];
-
-
-
- var p = function(t) {
-
-
- o.push(t);
- if (t.module.modules) {
- t.module.modules.keySort('ASC', l );
- t.module.modules.each(p);
- }
- if (t.finalize) {
- t.finalize.name = t.name + _T["afaa6ac88a5c532720f81ab8d1cf345d"];
- o.push(m.finalize);
- }
-
- }
-
-
- h.modules.each(p);
-
-
-
- if (!o.length) {
- if (j) j();
- return;
- }
-
-
- Ext.MessageBox.show({ title: 'loading' });
- Ext.MessageBox.show({
- title: _T["1c34c8962b28be597267aef253b4694b"],
- msg: _T["6a4a6d2119244f74b8d02f20ef005c5e"],
- width:450,
- progress:true,
- closable:false,
- modal: false
-
- });
- var n = 0;
- var q = function() {
-
- var m = o[n];
-
-
- Ext.MessageBox.updateProgress(
- (n+1)/o.length, _T["51ff98c417d79325f91861af9c61cfb3"] + (n+1) +
- _T["da27970c3ea08e35a23fb956908b78f4"] + o.length +
- (m.name ? (' - ' + m.name) : '')
- );
-
-
-
- if (typeof(m) == 'function') {
- m();
-
- } else {
- if (m.parent.layout && !m.module.disabled) {
- m.module.add(m.parent.layout, m.region);
- }
-
- }
-
-
-
- n++;
- if (n >= o.length) {
- j();
- return;
- }
-
-
-
- q.defer(10, Pman);
- }
-
- q.defer(1, Pman);
-
-
-
- },
-
- gtranslate : function(t, u, v, cb) {
-
-
-
- var x = new Roo.data.ScriptTagProxy({
- url: 'http://ajax.googleapis.com/ajax/services/language/translate',
- callbackParam : 'callback'
- });
- x.load(
- {
- v: '1.0',
- q : t,
- langpair : u + '|' +v
- },
- {
- readRecords : function (o) {
- if (!o.responseData) {
- return o;
- }
- return o.responseData.translatedText;
- }
- },
- function (w) {
- cb(w);
- },
- this,
- []
- );
-
-
-
- } ,
- invertColor : function(c)
- {
-
- var ca = [];
- for(var i = 0; i < 3; i++){
- ca[i] = parseInt(c.charAt((i*2)+1) + c.charAt((i*2)+2), 16);
- }
-
-
- var w = '';
- Roo.each(ca, function(hi) {
- var h = parseInt(255-hi).toString(16);
- if(h < 16){
- h = '0' + h;
- }
-
- w += h;
- });
- return '#' + w;
-
- }
-
-
-
-
-
-
-
-});
-
-
-
-
-Pman.Readers.Companies = {
- root : 'data',
- totalProperty : 'total',
- id : 'id',
- xtype : 'JsonReader',
- fields : [
- 'code',
- 'name',
- 'remarks',
- {name : 'owner_id',type : 'int'},
- 'address',
- 'tel',
- 'fax',
- 'email',
- {name : 'id',type : 'int'},
- {name : 'isOwner',type : 'int'},
- {name : 'logo_id',type : 'int'},
- 'background_color',
- 'comptype',
- 'ava_craft',
- 'url',
- {name : 'main_office_id',type : 'int'},
- {name : 'created_by',type : 'int'},
- {name : 'created_dt',type : 'date',dateFormat : 'Y-m-d H:i:s'},
- {name : 'updated_by',type : 'int'},
- {name : 'updated_dt',type : 'date',dateFormat : 'Y-m-d H:i:s'},
- 'passwd',
- {name : 'logo_id_id',type : 'int'},
- 'logo_id_filename',
- 'logo_id_ontable',
- {name : 'logo_id_onid',type : 'int'},
- 'logo_id_mimetype',
- {name : 'logo_id_width',type : 'int'},
- {name : 'logo_id_height',type : 'int'},
- {name : 'logo_id_filesize',type : 'int'},
- {name : 'logo_id_displayorder',type : 'int'},
- 'logo_id_language',
- {name : 'logo_id_parent_image_id',type : 'int'},
- {name : 'logo_id_created',type : 'date',dateFormat : 'Y-m-d H:i:s'},
- 'logo_id_imgtype',
- 'logo_id_linkurl',
- 'logo_id_descript',
- 'logo_id_title',
- {name : 'owner_id_id',type : 'int'},
- {name : 'owner_id_office_id',type : 'int'},
- 'owner_id_name',
- 'owner_id_phone',
- 'owner_id_fax',
- 'owner_id_email',
- {name : 'owner_id_company_id',type : 'int'},
- 'owner_id_role',
- {name : 'owner_id_active',type : 'int'},
- 'owner_id_remarks',
- 'owner_id_passwd',
- {name : 'owner_id_owner_id',type : 'int'},
- 'owner_id_lang',
- {name : 'owner_id_no_reset_sent',type : 'int'},
- {name : 'owner_id_project_id',type : 'int'},
- 'owner_id_action_type',
- {name : 'main_office_id_id',type : 'int'},
- {name : 'main_office_id_company_id',type : 'int'},
- 'main_office_id_name',
- 'main_office_id_address',
- 'main_office_id_phone',
- 'main_office_id_fax',
- 'main_office_id_email',
- 'main_office_id_role'
- ]
-};
-
-Pman.Readers.Events = {
- root : 'data',
- totalProperty : 'total',
- id : 'id',
- xtype : 'JsonReader',
- fields : [
- {name : 'id',type : 'int'},
- 'person_name',
- {name : 'event_when',type : 'date',dateFormat : 'Y-m-d H:i:s'},
- 'action',
- 'ipaddr',
- {name : 'on_id',type : 'int'},
- 'on_table',
- {name : 'person_id',type : 'int'},
- 'remarks',
- {name : 'person_id_id',type : 'int'},
- {name : 'person_id_office_id',type : 'int'},
- 'person_id_name',
- 'person_id_phone',
- 'person_id_fax',
- 'person_id_email',
- {name : 'person_id_company_id',type : 'int'},
- 'person_id_role',
- {name : 'person_id_active',type : 'int'},
- 'person_id_remarks',
- 'person_id_passwd',
- {name : 'person_id_owner_id',type : 'int'},
- 'person_id_lang',
- {name : 'person_id_no_reset_sent',type : 'int'},
- {name : 'person_id_project_id',type : 'int'},
- 'person_id_action_type'
- ]
-};
-
-Pman.Readers.Group_Members = {
- root : 'data',
- totalProperty : 'total',
- id : 'id',
- xtype : 'JsonReader',
- fields : [
- {name : 'group_id',type : 'int'},
- {name : 'id',type : 'int'},
- {name : 'user_id',type : 'int'},
- {name : 'group_id_id',type : 'int'},
- 'group_id_name',
- {name : 'group_id_type',type : 'int'},
- {name : 'group_id_leader',type : 'int'},
- {name : 'user_id_id',type : 'int'},
- {name : 'user_id_office_id',type : 'int'},
- 'user_id_name',
- 'user_id_phone',
- 'user_id_fax',
- 'user_id_email',
- {name : 'user_id_company_id',type : 'int'},
- 'user_id_role',
- {name : 'user_id_active',type : 'int'},
- 'user_id_remarks',
- 'user_id_passwd',
- {name : 'user_id_owner_id',type : 'int'},
- 'user_id_lang',
- {name : 'user_id_no_reset_sent',type : 'int'},
- {name : 'user_id_project_id',type : 'int'},
- 'user_id_action_type'
- ]
-};
-
-Pman.Readers.Group_Rights = {
- root : 'data',
- totalProperty : 'total',
- id : 'id',
- xtype : 'JsonReader',
- fields : [
- 'rightname',
- {name : 'group_id',type : 'int'},
- 'AccessMask',
- {name : 'id',type : 'int'},
- {name : 'group_id_id',type : 'int'},
- 'group_id_name',
- {name : 'group_id_type',type : 'int'},
- {name : 'group_id_leader',type : 'int'}
- ]
-};
-
-Pman.Readers.Groups = {
- root : 'data',
- totalProperty : 'total',
- id : 'id',
- xtype : 'JsonReader',
- fields : [
- {name : 'id',type : 'int'},
- 'name',
- {name : 'type',type : 'int'},
- {name : 'leader',type : 'int'},
- {name : 'leader_id',type : 'int'},
- {name : 'leader_office_id',type : 'int'},
- 'leader_name',
- 'leader_phone',
- 'leader_fax',
- 'leader_email',
- {name : 'leader_company_id',type : 'int'},
- 'leader_role',
- {name : 'leader_active',type : 'int'},
- 'leader_remarks',
- 'leader_passwd',
- {name : 'leader_owner_id',type : 'int'},
- 'leader_lang',
- {name : 'leader_no_reset_sent',type : 'int'},
- {name : 'leader_project_id',type : 'int'},
- 'leader_action_type'
- ]
-};
-
-Pman.Readers.Images = {
- root : 'data',
- totalProperty : 'total',
- id : 'id',
- xtype : 'JsonReader',
- fields : [
- {name : 'id',type : 'int'},
- 'filename',
- 'ontable',
- {name : 'onid',type : 'int'},
- 'mimetype',
- {name : 'width',type : 'int'},
- {name : 'height',type : 'int'},
- {name : 'filesize',type : 'int'},
- {name : 'displayorder',type : 'int'},
- 'language',
- {name : 'parent_image_id',type : 'int'},
- {name : 'created',type : 'date',dateFormat : 'Y-m-d H:i:s'},
- 'imgtype',
- 'linkurl',
- 'descript',
- 'title',
- {name : 'parent_image_id_id',type : 'int'},
- 'parent_image_id_filename',
- 'parent_image_id_ontable',
- {name : 'parent_image_id_onid',type : 'int'},
- 'parent_image_id_mimetype',
- {name : 'parent_image_id_width',type : 'int'},
- {name : 'parent_image_id_height',type : 'int'},
- {name : 'parent_image_id_filesize',type : 'int'},
- {name : 'parent_image_id_displayorder',type : 'int'},
- 'parent_image_id_language',
- {name : 'parent_image_id_parent_image_id',type : 'int'},
- {name : 'parent_image_id_created',type : 'date',dateFormat : 'Y-m-d H:i:s'},
- 'parent_image_id_imgtype',
- 'parent_image_id_linkurl',
- 'parent_image_id_descript',
- 'parent_image_id_title'
- ]
-};
-
-Pman.Readers.Office = {
- root : 'data',
- totalProperty : 'total',
- id : 'id',
- xtype : 'JsonReader',
- fields : [
- {name : 'id',type : 'int'},
- {name : 'company_id',type : 'int'},
- 'name',
- 'address',
- 'phone',
- 'fax',
- 'email',
- 'role',
- 'company_id_code',
- 'company_id_name',
- 'company_id_remarks',
- {name : 'company_id_owner_id',type : 'int'},
- 'company_id_address',
- 'company_id_tel',
- 'company_id_fax',
- 'company_id_email',
- {name : 'company_id_id',type : 'int'},
- {name : 'company_id_isOwner',type : 'int'},
- {name : 'company_id_logo_id',type : 'int'},
- 'company_id_background_color',
- 'company_id_comptype',
- 'company_id_ava_craft',
- 'company_id_url',
- {name : 'company_id_main_office_id',type : 'int'},
- {name : 'company_id_created_by',type : 'int'},
- {name : 'company_id_created_dt',type : 'date',dateFormat : 'Y-m-d H:i:s'},
- {name : 'company_id_updated_by',type : 'int'},
- {name : 'company_id_updated_dt',type : 'date',dateFormat : 'Y-m-d H:i:s'},
- 'company_id_passwd'
- ]
-};
-
-Pman.Readers.Person = {
- root : 'data',
- totalProperty : 'total',
- id : 'id',
- xtype : 'JsonReader',
- fields : [
- {name : 'id',type : 'int'},
- {name : 'office_id',type : 'int'},
- 'name',
- 'phone',
- 'fax',
- 'email',
- {name : 'company_id',type : 'int'},
- 'role',
- {name : 'active',type : 'int'},
- 'remarks',
- 'passwd',
- {name : 'owner_id',type : 'int'},
- 'lang',
- {name : 'no_reset_sent',type : 'int'},
- {name : 'project_id',type : 'int'},
- 'action_type',
- {name : 'office_id_id',type : 'int'},
- {name : 'office_id_company_id',type : 'int'},
- 'office_id_name',
- 'office_id_address',
- 'office_id_phone',
- 'office_id_fax',
- 'office_id_email',
- 'office_id_role',
- 'company_id_code',
- 'company_id_name',
- 'company_id_remarks',
- {name : 'company_id_owner_id',type : 'int'},
- 'company_id_address',
- 'company_id_tel',
- 'company_id_fax',
- 'company_id_email',
- {name : 'company_id_id',type : 'int'},
- {name : 'company_id_isOwner',type : 'int'},
- {name : 'company_id_logo_id',type : 'int'},
- 'company_id_background_color',
- 'company_id_comptype',
- 'company_id_ava_craft',
- 'company_id_url',
- {name : 'company_id_main_office_id',type : 'int'},
- {name : 'company_id_created_by',type : 'int'},
- {name : 'company_id_created_dt',type : 'date',dateFormat : 'Y-m-d H:i:s'},
- {name : 'company_id_updated_by',type : 'int'},
- {name : 'company_id_updated_dt',type : 'date',dateFormat : 'Y-m-d H:i:s'},
- 'company_id_passwd',
- {name : 'project_id_id',type : 'int'},
- 'project_id_name',
- 'project_id_remarks',
- {name : 'project_id_owner_id',type : 'int'},
- 'project_id_code',
- {name : 'project_id_active',type : 'int'},
- 'project_id_type',
- {name : 'project_id_client_id',type : 'int'},
- {name : 'project_id_team_id',type : 'int'},
- 'project_id_file_location',
- {name : 'project_id_open_date',type : 'date',dateFormat : 'Y-m-d'},
- {name : 'project_id_open_by',type : 'int'},
- 'project_id_countries',
- 'project_id_languages',
- {name : 'project_id_close_date',type : 'date',dateFormat : 'Y-m-d'},
- {name : 'project_id_agency_id',type : 'int'},
- {name : 'owner_id_id',type : 'int'},
- {name : 'owner_id_office_id',type : 'int'},
- 'owner_id_name',
- 'owner_id_phone',
- 'owner_id_fax',
- 'owner_id_email',
- {name : 'owner_id_company_id',type : 'int'},
- 'owner_id_role',
- {name : 'owner_id_active',type : 'int'},
- 'owner_id_remarks',
- 'owner_id_passwd',
- {name : 'owner_id_owner_id',type : 'int'},
- 'owner_id_lang',
- {name : 'owner_id_no_reset_sent',type : 'int'},
- {name : 'owner_id_project_id',type : 'int'},
- 'owner_id_action_type'
- ]
-};
-
-Pman.Readers.Projects = {
- root : 'data',
- totalProperty : 'total',
- id : 'id',
- xtype : 'JsonReader',
- fields : [
- {name : 'id',type : 'int'},
- 'name',
- 'remarks',
- {name : 'owner_id',type : 'int'},
- 'code',
- {name : 'active',type : 'int'},
- 'type',
- {name : 'client_id',type : 'int'},
- {name : 'team_id',type : 'int'},
- 'file_location',
- {name : 'open_date',type : 'date',dateFormat : 'Y-m-d'},
- {name : 'open_by',type : 'int'},
- 'countries',
- 'languages',
- {name : 'close_date',type : 'date',dateFormat : 'Y-m-d'},
- {name : 'agency_id',type : 'int'},
- 'client_id_code',
- 'client_id_name',
- 'client_id_remarks',
- {name : 'client_id_owner_id',type : 'int'},
- 'client_id_address',
- 'client_id_tel',
- 'client_id_fax',
- 'client_id_email',
- {name : 'client_id_id',type : 'int'},
- {name : 'client_id_isOwner',type : 'int'},
- {name : 'client_id_logo_id',type : 'int'},
- 'client_id_background_color',
- 'client_id_comptype',
- 'client_id_ava_craft',
- 'client_id_url',
- {name : 'client_id_main_office_id',type : 'int'},
- {name : 'client_id_created_by',type : 'int'},
- {name : 'client_id_created_dt',type : 'date',dateFormat : 'Y-m-d H:i:s'},
- {name : 'client_id_updated_by',type : 'int'},
- {name : 'client_id_updated_dt',type : 'date',dateFormat : 'Y-m-d H:i:s'},
- 'client_id_passwd',
- 'agency_id_code',
- 'agency_id_name',
- 'agency_id_remarks',
- {name : 'agency_id_owner_id',type : 'int'},
- 'agency_id_address',
- 'agency_id_tel',
- 'agency_id_fax',
- 'agency_id_email',
- {name : 'agency_id_id',type : 'int'},
- {name : 'agency_id_isOwner',type : 'int'},
- {name : 'agency_id_logo_id',type : 'int'},
- 'agency_id_background_color',
- 'agency_id_comptype',
- 'agency_id_ava_craft',
- 'agency_id_url',
- {name : 'agency_id_main_office_id',type : 'int'},
- {name : 'agency_id_created_by',type : 'int'},
- {name : 'agency_id_created_dt',type : 'date',dateFormat : 'Y-m-d H:i:s'},
- {name : 'agency_id_updated_by',type : 'int'},
- {name : 'agency_id_updated_dt',type : 'date',dateFormat : 'Y-m-d H:i:s'},
- 'agency_id_passwd',
- {name : 'team_id_id',type : 'int'},
- 'team_id_name',
- {name : 'team_id_type',type : 'int'},
- {name : 'team_id_leader',type : 'int'},
- {name : 'open_by_id',type : 'int'},
- {name : 'open_by_office_id',type : 'int'},
- 'open_by_name',
- 'open_by_phone',
- 'open_by_fax',
- 'open_by_email',
- {name : 'open_by_company_id',type : 'int'},
- 'open_by_role',
- {name : 'open_by_active',type : 'int'},
- 'open_by_remarks',
- 'open_by_passwd',
- {name : 'open_by_owner_id',type : 'int'},
- 'open_by_lang',
- {name : 'open_by_no_reset_sent',type : 'int'},
- {name : 'open_by_project_id',type : 'int'},
- 'open_by_action_type',
- {name : 'owner_id_id',type : 'int'},
- {name : 'owner_id_office_id',type : 'int'},
- 'owner_id_name',
- 'owner_id_phone',
- 'owner_id_fax',
- 'owner_id_email',
- {name : 'owner_id_company_id',type : 'int'},
- 'owner_id_role',
- {name : 'owner_id_active',type : 'int'},
- 'owner_id_remarks',
- 'owner_id_passwd',
- {name : 'owner_id_owner_id',type : 'int'},
- 'owner_id_lang',
- {name : 'owner_id_no_reset_sent',type : 'int'},
- {name : 'owner_id_project_id',type : 'int'},
- 'owner_id_action_type'
- ]
-};
-
-Pman.Readers.I18n = {
- root : 'data',
- totalProperty : 'total',
- id : 'id',
- xtype : 'JsonReader',
- fields : [
- {name : 'id',type : 'int'},
- 'ltype',
- 'lkey',
- 'inlang',
- 'lval'
- ]
-};
-
-Pman.Readers.Proftp_groups = {
- root : 'data',
- totalProperty : 'total',
- id : 'id',
- xtype : 'JsonReader',
- fields : [
- {name : 'id',type : 'int'},
- {name : 'grpid',type : 'int'},
- 'grpname',
- 'grpmembers'
- ]
-};
-
-Pman.Readers.Translations = {
- root : 'data',
- totalProperty : 'total',
- id : 'id',
- xtype : 'JsonReader',
- fields : [
- {name : 'id',type : 'int'},
- 'module',
- 'tfile',
- 'tlang',
- 'tkey',
- 'tval'
- ]
-};
-
-
-
-
-Pman.Dialog.Companies = new Roo.util.Observable({
- events : {
- 'beforerender' : true,
- 'show' : true,
- 'beforesave' : true
- },
-
- dialog : false,
- form : false,
- callback: false,
- create: function()
- {
- if (this.dialog) {
- return;
- }
-
-
- this.dialog = new Ext.LayoutDialog(Ext.get(document.body).createChild({tag:'div'}), {
- autoCreated: true,
- title: _T["daed45fe377199115ee46b87eb340dcc"],
- modal: true,
- width: 750,
- height: 400,
- shadow:true,
- minWidth:200,
- minHeight:180,
-
- collapsible : false,
- closable: false,
- draggable: false,
- center: {
- autoScroll:false,
- titlebar: false,
-
- hideTabs: true,
- closeOnTab: true,
- alwaysShowTabs: false
- }
- });
- this.dialog.addKeyListener(27, this.dialog.hide, this.dialog);
- this.dialog.addButton(_T["e35c34d957d7aebd0c9e37aa77f50b70"], this.dialog.hide, this.dialog);
-
- this.dialog.addButton(_T["59c001255d821a2e12e8fb705dba9fea"], this.save, this);
- this.layout = this.dialog.getLayout();
- this.layout.beginUpdate();
-
- var A = this;
-
- this.form = new Ext.form.Form({
- labelWidth: 150 ,
-
- fileUpload : true,
- listeners : {
- actionfailed : function(f, B) {
- A.dialog.el.unmask();
-
- Pman.standardActionFailed(f,B);
-
- },
- actioncomplete: function(f, C) {
- A.dialog.el.unmask();
-
-
-
-
- if (C.type == 'load') {
-
- A.data = C.result.data;
- var meth = A.data.isOwner || !Pman.Login.isOwner() ? 'disable' : 'enable';
-
-
- if (A.form.findField('comptype')) {
- A.form.findField('comptype')[meth]();
- }
-
-
- return;
- }
-
-
- if (C.type == 'submit') {
- A.dialog.hide();
-
- if (A.callback) {
- A.callback.call(this, C.result.data);
- }
- return;
- }
-
- }
- }
-
-
-
-
- });
-
-
- this.form.addxtype.apply(this.form, this.getFormFields());
- this.fireEvent('beforeRender', this );
-
- var ef = this.dialog.getLayout().getEl().createChild({tag: 'div'});
- ef.dom.style.margin = 10;
-
- this.form.render(ef.dom);
-
- var vp = this.dialog.getLayout().add('center', new Ext.ContentPanel(ef, {
- autoCreate : true,
-
-
- width: 250,
- maxWidth: 250,
- fitToFrame:true
- }));
-
-
-
-
- this.layout.endUpdate();
- },
- show : function (B, C)
- {
- this.callback = C;
- this._id = B.id ? B.id : 0;
- this.create();
- this.data = B;
- this.form.reset();
- if (B._fetch) {
- this.dialog.show();
- this.dialog.el.mask(_T["5f679f3c301a24b3f538a9766ee3ae6e"]);
- this.form.doAction('load', {
- url: baseURL + '/Roo/Companies.html',
- method: 'GET',
- params: {
- _id: this._id ,
- _ts : Math.random()
- }
- });
- this.fireEvent('show');
- return;
- } else {
- this.form.setValues(B);
- }
-
-
-
-
- this.dialog.show();
-
- if (B.isOwner || !Pman.Login.isOwner()) {
- this.dialog.setTitle(_T["1f0d43f377b93713beb48cbaca0e4401"]);
- if (this.form.findField('comptype')) {
- this.form.findField('comptype').disable();
- }
-
-
-
-
- } else {
- this.dialog.setTitle(B.id ? _T["4cf24f0f74944b39fd350182d5e15817"] : _T["ce9ba64bb3f29723e000efb2e80abb8e"]);
- if (this.form.findField('comptype')) {
- this.form.findField('comptype').enable();
- }
- }
-
- this.fireEvent('show');
-
- },
-
-
- save : function()
- {
- this.form.fileUpload = this.form.findField('imageUpload') ? true : false;
- this.fireEvent('beforesave');
- this.form.doAction('submit', {
- url: baseURL + '/Roo/Companies.html',
- method: 'POST',
- params: {
- _id: this._id ,
- ts : Math.random()
- }
- });
- },
-
- comptypeList : function()
- {
-
- return [
-
- [ 'CONSULTANT', _T["650deecbb5e829066db9b03be1125a1c"] ],
- [ 'CLIENT' , _T["59bfcea58d8c79f4a8cc2ce8256a167a"] ],
- [ 'CONTRACTOR' , _T["692e49978c615ffee8b37ed3a8ef2a12"] ],
-
- ];
- },
- comptypeListToString: function(v) {
- if (!v.length) {
- return '';
- }
- if (v== _T["e3aa17d446c7005272762934b3b1e1a0"]) {
- return _T["3fbd4316b2e824257633036893085545"];
- }
- var a = this.comptypeList();
- var D = '';
- Roo.each(a, function( ar) {
- if (ar[0] == v) {
- D = ar[1];
- return false;
- }
- });
- return D;
-
-
-
- },
-
- getFormFields : function() {
- return [
- {
- xtype : 'Column',
- width: 500,
- items: [
- this.c_code(),
- this.c_comptype_name(),
- this.c_name(),
- this.c_tel(),
- this.c_fax(),
- this.c_email(),
-
-
- this.c_address(),
- this.c_remarks(),
- ]
- },
- {
- xtype : 'Column',
- width: 200,
- labelAlign: 'top',
- items : [
- this.c_background_color(),
- this.c_image_edit()
-
-
- ]
- },
- this.c_isOwner(),
- this.c_id()
- ];
- },
-
-
- c_code : function() {
- return {
- name : 'code',
- fieldLabel : _T["857adf078513b5f11f815595aa0f9fd1"],
- value : '',
- allowBlank : false,
- qtip : _T["75d069b37c5159f5acb5d01d10a2d9a3"],
- xtype : 'TextField',
- width : 100
- }
- },
- c_comptype_name : function() {
- return {
-
- fieldLabel : 'Type',
- disabled : Pman.Login.isOwner() ? false : true,
- name : 'comptype_name',
- xtype : 'ComboBox',
- allowBlank : false,
- qtip : 'Select Company type',
-
- width: 200,
- xns : Roo.form,
-
- listWidth : 250,
-
-
- store: {
- xtype : 'SimpleStore',
- fields: ['val', 'desc'],
- data : this.comptypeList()
- },
- displayField:'desc',
- valueField: 'val',
- hiddenName : 'comptype',
-
- typeAhead: false,
- editable: false,
-
- triggerAction: 'all',
- emptyText: _T["81cbd120755795f72b127151e540cde5"],
- selectOnFocus: true
-
-
- }
- },
- c_name : function() {
- return {
-
- name : 'name',
- fieldLabel : _T["37b6f9357707805a4612ebc166766ee2"],
- value : '',
- allowBlank : true,
- qtip : _T["d0845cdf23eb01488ec78802847e0273"],
- xtype : 'TextField',
- width : 300
- }
- },
- c_tel : function() {
- return {
-
- name : 'tel',
- fieldLabel : _T["f111792776dd00af4e9575dffce62c41"],
- value : '',
- allowBlank : true,
- qtip : _T["7512ebcca5961d7894b501b6b0556c36"],
- xtype : 'TextField',
- width : 300
- }
- },
- c_fax : function() {
- return {
-
- name : 'fax',
- fieldLabel : _T["5595a13ebb30e328ffb5b6def210a94c"],
- value : '',
- allowBlank : true,
- qtip : _T["73fe964a2d78700ea90ec792a87cb425"],
- xtype : 'TextField',
- width : 300
- }
- },
- c_email : function() {
- return {
-
- name : 'email',
- fieldLabel : _T["4e3ed651f76a84604309db4a263b8e44"],
- value : '',
- allowBlank : true,
- qtip : _T["5caf4f1f1ea765a217064568800b9eee"],
- xtype : 'TextField',
- width : 300
- }
- },
- c_address : function() {
- return {
-
- name : 'address',
- fieldLabel : _T["7688941a47dfb4d4edaaf460f81d69ab"],
- value : '',
- allowBlank : true,
- qtip : _T["bcde687f68818bdff785998f3f4b4dcc"],
- xtype : 'TextArea',
- height : 70,
- width : 300
- }
- },
- c_remarks : function() {
- return {
-
- name : 'remarks',
- fieldLabel : _T["7931e6a8fdc03aeb23619c11057cfb46"],
- value : '',
- allowBlank : true,
- qtip : _T["978731b3f7cb08990f958c25b4cc9702"],
- xtype : 'TextArea',
- height : 40,
- width : 300
- }
- },
- c_background_color : function() {
- return {
- xtype: 'ColorField',
- name : 'background_color',
- fieldLabel: _T["4c63cd35411e0bfe84d30f523cf6b93a"]
- }
- },
- c_image_view : function() {
- var E = this;
- return {
- xtype : 'FieldSetEx',
- name : 'image-view',
- collapseGroup : 'companies-image',
- value: 0,
- labelWidth: 100,
- expanded: true,
- style: 'width:420px;',
- legend : _T["9c24ec3378fb01fb54d25c2075d3293d"],
- items: [
- {
- xtype : 'DisplayImage',
- name : 'logo_id',
- fieldLabel : 'Logo Image',
- width: 300,
- height: 50,
- renderer : function(v) {
- return v ? String.format('<img src="{0}" height="{1}">',
- baseURL + '/Images/' + v + '/' + E.data.logo_id_filename,
- Math.min(this.height, E.data.logo_id_height)) : _T["31e77d71bd68053a7d6fcd4bc974af6a"];
-
- }
- }
- ]
-
- }
- },
- c_image_edit : function() {
- var F = this;
- return {
- name : 'logo_id',
- fieldLabel : _T["9c24ec3378fb01fb54d25c2075d3293d"],
- value : '',
- allowBlank : true,
- style: 'border: 1px solid #ccc;',
- xtype : 'DisplayImage',
- width : 170,
- height: 170,
- addTitle : _T["8ffc3bf05859510e6dc4613b607cdcbe"],
- icon: Roo.rootURL + 'images/default/dd/drop-add.gif',
- handler : function() {
- var _t = this;
-
- Pman.Dialog.Image.show({
- onid :F.data.id,
- ontable : 'Companies',
- imgtype : '-LOGO'
- }, function(G) {
- if (G) {
- _t.setValue(G.id);
- }
-
- });
- },
- renderer : function(v) {
-
- if (!v) {
- return _T["0e671bf5ff1cf6b299f895f78678121b"] + '<BR/>';
- }
- return String.format('<img src="{0}" width="150">',
- baseURL + '/Images/Thumb/150x150/' + v + '/logo.jpg'
- );
- }
-
- } ;
-
- },
- c_image_change: function() {
- return {
- xtype : 'FieldSetEx',
- collapseGroup : 'companies-image',
- name : 'image-change',
- value: 0,
- labelWidth: 100,
- expanded: false,
- style: 'width:420px;',
- legend : _T["490679f6791d65bc9998cadb629c7053"],
- items : [
- {
- xtype : 'TextField',
- name : 'imageUpload',
- fieldLabel : _T["f5978f4e5815e0516744069dd287e5d9"],
- inputType : 'file'
- }
- ]
- }
- },
- c_isOwner : function() {
- return {
- name : 'isOwner',
- value : '',
- xtype : 'Hidden'
- }
- },
- c_id : function() {
- return {
- name : 'id',
- value : '',
- xtype : 'Hidden'
- }
- }
-
-});
-
-
-
-Pman.Dialog.Document_Types = {
- dialog : false,
- form : false,
- create: function()
- {
- if (this.dialog) {
- return;
- }
-
-
- this.dialog = new Ext.LayoutDialog(Ext.get(document.body).createChild({tag:'div'}), {
- autoCreated: true,
- title: _T["9566c872f5eb3606aff77e92ef404f6f"],
- modal: true,
- width: 650,
- height: 250,
- shadow:true,
- minWidth:200,
- minHeight:180,
-
- closable: false,
- draggable: false,
- center: {
- autoScroll:false,
- titlebar: false,
-
- hideTabs: true,
- closeOnTab: true,
- alwaysShowTabs: false
- }
- });
- this.dialog.addKeyListener(27, this.dialog.hide, this.dialog);
- this.dialog.addButton(_T["918b8aa8008529245b10c94d04e201c6"], this.dialog.hide, this.dialog);
-
- this.dialog.addButton(_T["7b0411b72ad383c3e2260d2293b0e2f7"], this.save, this);
- this.layout = this.dialog.getLayout();
- this.layout.beginUpdate();
-
- var dg = Pman.Dialog.Document_Types;
-
- this.form = new Ext.form.Form({
- labelWidth: 250 ,
- listeners : {
- actionfailed : function(f, A) {
- dg.dialog.el.unmask();
-
-
- Pman.standardActionFailed(f,A);
-
- },
- actioncomplete: function(f, B) {
- dg.dialog.el.unmask();
-
-
-
-
- if (B.type == 'load') {
-
- dg.data = B.result.data;
-
- return;
- }
-
-
- if (B.type == 'submit') {
- dg.dialog.hide();
- if (dg.callback) {
- dg.callback.call(this, B.result.data);
- }
- return;
- }
-
- }
- }
-
-
-
-
- });
-
- this.form.addxtype.apply(this.form,[{
- name : 'code',
- fieldLabel : _T["3856b4848e0006d06445a3ec0026e6b9"],
- value : '',
- allowBlank : false,
- qtip : _T["ba960e685bbb3f9c913365a52e998454"],
- xtype : 'TextField',
- width : 100
- },{
- name : 'name',
- fieldLabel : _T["04c4d9039b04ae1bb4143edcd3310cc3"],
- value : '',
- allowBlank : true,
- qtip : _T["16fdbf7788088cd5e4251adddf31957e"],
- xtype : 'TextField',
- width : 300
- },{
- name : 'remarks',
- fieldLabel : _T["ff98eddf5a2bfb7ab13af0efe685783b"],
- value : '',
- allowBlank : true,
- qtip : _T["cfa368a58af37baf0ff74f80a9d7f192"],
- xtype : 'TextArea',
- height : 100,
- width : 300
- },{
- name : 'id',
- value : '',
- xtype : 'Hidden'
-
-
- }
- ]);
- var ef = this.dialog.getLayout().getEl().createChild({tag: 'div'});
- ef.dom.style.margin = 10;
-
- this.form.render(ef.dom);
-
- var vp = this.dialog.getLayout().add('center', new Ext.ContentPanel(ef, {
- autoCreate : true,
-
-
- width: 250,
- maxWidth: 250,
- fitToFrame:true
- }));
-
-
-
-
- this.layout.endUpdate();
- },
- _id : 0,
- show: function (A, B)
- {
-
- this.callback = B;
- this._id = A.id ? A.id : 0;
- this.create();
- this.form.reset();
-
- this.form.setValues(A);
-
- this.dialog.show();
-
-
- },
-
- save : function()
- {
- this.form.doAction('submit', {
- url: baseURL + '/Roo/Document_Types.html',
- method: 'POST',
- params: {
- _id: this._id ,
- ts : Math.random()
- }
- });
- }
-
-
-
-
-
-};
-
-
-Pman.Dialog.Image = {
- dialog : false,
- form : false,
- create: function()
- {
- if (this.dialog) {
- return;
- }
- var A = this;
-
- this.dialog = new Ext.LayoutDialog(Ext.get(document.body).createChild({tag:'div'}), {
- autoCreated: true,
- title: _T["180ab418d1431a5e3ab16412df46995c"],
- modal: true,
- width: 500,
- height: 140,
- shadow:true,
- minWidth:200,
- minHeight:180,
-
- closable: false,
- draggable: false,
- center: {
- autoScroll:false,
- titlebar: false,
-
- hideTabs: true,
- closeOnTab: true,
- alwaysShowTabs: false
- }
- });
- this.dialog.addKeyListener(27, this.dialog.hide, this.dialog);
- this.dialog.addButton(_T["584228d91d54c791da0c7b9f60eb0568"], this.dialog.hide, this.dialog);
-
- this.dialog.addButton(_T["e7cf748ba346b55abdcc4b23eee865f2"], this.save, this);
- this.layout = this.dialog.getLayout();
- this.layout.beginUpdate();
-
-
- this.form = new Ext.form.Form({
- labelWidth: 150 ,
- fileUpload : true,
- listeners : {
- actionfailed : function(f, B) {
- A.uploadComplete = true;
- A.dialog.el.unmask();
-
-
- if (B.type == 'submit') {
- Ext.MessageBox.alert(_T["f63d2ff3c0824d9a6d914b023170a0e7"], _T["de7fa9da20484d1ee51e3e11385b106a"]);
- return;
- }
-
-
-
- Ext.MessageBox.alert(_T["f63d2ff3c0824d9a6d914b023170a0e7"], _T["6bb7047abac30e5f215a55ee1258d63e"]);
-
- },
- actioncomplete: function(f, C) {
- A.uploadComplete = true;
- A.dialog.el.unmask();
-
-
- if (C.type == 'load') {
-
- A.data = C.result.data;
-
- return;
- }
-
-
- if (C.type == 'submit') {
- A.dialog.hide();
-
- if (A.callback) {
- A.callback.call(this, C.result.data);
- }
- return;
- }
-
- }
- }
-
-
-
-
- });
-
- this.form.addxtype.apply(this.form,
- [
-
- { name: 'UPLOAD_IDENTIFIER' , xtype: 'Hidden' },
- {
- xtype : 'TextField',
- name : 'imageUpload',
- fieldLabel : _T["6644290819b3cd82cd7a447b4f9082d9"],
- inputType : 'file'
- },
- { name: 'ontable', xtype: 'Hidden' },
- { name: 'onid', xtype: 'Hidden' },
- { name: 'imgtype', xtype: 'Hidden' },
- { name: 'post_max_size', xtype: 'Hidden' , value :'32M'} ,
- { name: 'upload_max_filesize', xtype: 'Hidden' , value :'32M'}
-
-
-
- ]
-
- );
- var ef = this.dialog.getLayout().getEl().createChild({tag: 'div'});
- ef.dom.style.margin = 10;
-
- this.form.render(ef.dom);
-
- var vp = this.dialog.getLayout().add('center', new Ext.ContentPanel(ef, {
- autoCreate : true,
-
-
- width: 250,
- maxWidth: 250,
- fitToFrame:true
- }));
-
-
-
-
- this.layout.endUpdate();
- },
- _id : 0,
-
- show: function (B, C)
- {
-
- this.callback = C;
- this.create();
- this.form.reset();
-
- this.form.setValues(B);
- this.form.findField('UPLOAD_IDENTIFIER').setValue((new Date() * 1) + '' + Math.random());
- this.dialog.show();
-
-
- },
-
- save : function()
- {
- this.dialog.el.mask(_T["7e627bc5cadbc3aa73653b2e65eebf41"]);
- this.uploadComplete = false;
- this.form.doAction('submit', {
- url: baseURL + '/Roo/Images.html',
- method: 'POST',
- params: {
-
- ts : Math.random()
- }
- });
- this.haveProgress = false,
- this.uploadProgress.defer(1000, this);
-
- },
- uploadComplete : false,
- haveProgress: false,
- uploadProgress : function()
- {
- if (!this.haveProgress) {
- Roo.MessageBox.progress(_T["3b504c4d3b791c1aa278926f21482646"], _T["3b504c4d3b791c1aa278926f21482646"]);
- }
- if (this.uploadComplete) {
- Roo.MessageBox.hide();
- return;
- }
-
- this.haveProgress = true;
- var D = this;
- var E = this.form.findField('UPLOAD_IDENTIFIER').getValue();
- Pman.request({
- url : baseURL + '/Core/UploadProgress.php',
- params: {
- id : E
- },
- method: 'GET',
- success : function(F){
-
- if (D.uploadComplete) {
- Roo.MessageBox.hide();
- return;
- }
-
- if (F){
- Roo.MessageBox.updateProgress(F.bytes_uploaded/F.bytes_total,
- Math.floor((F.bytes_total - F.bytes_uploaded)/1000) + 'k remaining'
- );
- }
-
- D.uploadProgress.defer(2000, D);
- },
- failure: function(G) {
-
-
- }
- })
-
-
-
- }
-
-
-
-
-
-};
-
-
-
-
-Pman.Dialog.Office = {
- dialog : false,
- form : false,
- create: function()
- {
- if (this.dialog) {
- return;
- }
-
-
- this.dialog = new Ext.LayoutDialog(Ext.get(document.body).createChild({tag:'div'}), {
- autoCreated: true,
- title: _T["7836ab6fe8fe6f6ec502b3108a13e21d"],
- modal: true,
- width: 650,
- height: 400,
- shadow:true,
- minWidth:200,
- minHeight:180,
-
- closable: false,
- draggable: false,
- center: {
- autoScroll:false,
- titlebar: false,
-
- hideTabs: true,
- closeOnTab: true,
- alwaysShowTabs: false
- }
- });
- this.dialog.addKeyListener(27, this.dialog.hide, this.dialog);
- this.dialog.addButton(_T["1832ff6f8f4dc04e11d8da18197bd04e"], this.dialog.hide, this.dialog);
-
- this.dialog.addButton(_T["09216d718e93d47e7fab400386e0e666"], this.save, this);
- this.layout = this.dialog.getLayout();
- this.layout.beginUpdate();
-
- var dg = Pman.Dialog.Office;
-
- this.form = new Ext.form.Form({
- labelWidth: 250 ,
- listeners : {
- actionfailed : function(f, A) {
- dg.dialog.el.unmask();
-
-
- Pman.standardActionFailed(f,A);
-
- },
- actioncomplete: function(f, B) {
- dg.dialog.el.unmask();
-
-
-
-
- if (B.type == 'load') {
-
- dg.data = B.result.data;
-
- return;
- }
-
-
- if (B.type == 'submit') {
- dg.dialog.hide();
- if (dg.callback) {
- dg.callback.call(this, B.result.data);
- }
- return;
- }
-
- }
- }
-
-
-
-
- });
-
- this.form.addxtype.apply(this.form,[{
- 'name' : 'id',
- 'value' : '',
- 'xtype' : 'Hidden'
-
- },{
- 'name' : 'company_id',
-
- 'value' : '',
- 'xtype' : 'Hidden'
- },{
- 'name' : 'company_id_name',
- 'fieldLabel' : _T["b41c4b23e06e87f60c5cb0bd5bf4de81"],
- 'value' : '',
- 'xtype' : 'TextField',
- readOnly : true,
-
- 'width' : 300
- },
- {
- 'name' : 'name',
- 'fieldLabel' : _T["526fafd56ab833df1f4ffd447600a9d1"],
- 'value' : '',
- 'allowBlank' : false,
- 'qtip' : _T["69424c2ba40b27522c5f582fbe4b754b"],
- 'xtype' : 'TextField',
- 'width' : 300
- },{
- 'name' : 'address',
- 'fieldLabel' : _T["1576472bc936da286e17816117c69800"],
- 'value' : '',
-
- 'qtip' : _T["c8805cab313fc29f3642f9a5c7f9aa64"],
- 'xtype' : 'TextArea',
- 'height' : 100,
- 'width' : 300
- },{
- 'name' : 'phone',
- 'fieldLabel' : _T["e726c3820bd60bc1c312fb8c51dc3642"],
- 'value' : '',
-
- 'qtip' : _T["085c2f603ebade12c9f292ef40fd6b07"],
- 'xtype' : 'TextField',
- 'width' : 300
- },{
- 'name' : 'fax',
- 'fieldLabel' : _T["85a92c56516f8b4fb28cef275e39aa59"],
- 'value' : '',
-
- 'qtip' : _T["4e53f9de03e95a51293bbd4c2518cc7d"],
- 'xtype' : 'TextField',
- 'width' : 300
- },{
- 'name' : 'email',
- 'fieldLabel' : _T["55d8a63eb4ad34aaf8a64e677a7ba02e"],
- 'value' : '',
-
- 'qtip' : _T["20c803184f4250311d36b34678a81e99"],
- 'xtype' : 'TextField',
- 'width' : 300
- }
- ]);
- var ef = this.dialog.getLayout().getEl().createChild({tag: 'div'});
- ef.dom.style.margin = 10;
-
- this.form.render(ef.dom);
-
- var vp = this.dialog.getLayout().add('center', new Ext.ContentPanel(ef, {
- autoCreate : true,
-
-
- width: 250,
- maxWidth: 250,
- fitToFrame:true
- }));
-
-
-
-
- this.layout.endUpdate();
- },
- _id : 0,
- show : function(A, B)
- {
- this.callback= B;
- this._id = A.id;
- this.create();
- this.form.reset();
-
-
- this.form.setValues(A);
- this.dialog.show();
- this.form.findField('name').focus();
-
-
- },
- save : function()
- {
- this.form.doAction('submit', {
- url: baseURL + '/Roo/Office.html',
- method: 'POST',
- params: {
- _id: this._id ,
- ts : Math.random()
- }
- });
- }
-
-
-
-};
-
-
-
-
-
-
-
-Pman.on('beforeload', function() {
-
-
-
- Pman.Dialog.PersonEdit = new Pman.Dialog.PersonEditor({
- type : 'edit',
- dialogConfig : {
- title: _T["bc619e5bc0e08070f5aea669b1afdba1"],
- height: 350
-
- },
- itemList : [
- 'company_id_name',
- 'office_id_name',
- 'name','role', 'phone', 'fax', 'email',
-
- 'passwd1', 'passwd2',
- 'id',
-
- 'company_id_email',
- 'company_id_address','company_id_tel','company_id_fax'
- ]
- });
-});
-
-
-Pman.Dialog.PersonEditor = function(A)
-{
-
- Roo.apply(this, A);
-
-};
-
-Pman.Dialog.PersonEditor.prototype = {
-
- itemList : false,
- dialogConfig : false,
- type : '',
-
-
- itemTypes : false,
-
- dialog : false,
- form : false,
- layout : false,
-
- callback: false,
- _id : false,
- data : false,
-
-
- create : function()
- {
- if (this.dialog) {
- return;
- }
- var B = this;
- this.dialog = new Ext.LayoutDialog(Ext.get(document.body).createChild({tag:'div'}),
- Roo.apply({
- autoCreated: true,
- title: 'Edit Contact Details',
- modal: true,
- width: 530,
- height: 300,
- shadow:true,
- minWidth:200,
- minHeight:180,
-
- closable: false,
- draggable: false,
- center: {
- autoScroll:false,
- titlebar: false,
-
- hideTabs: true,
- closeOnTab: true,
- alwaysShowTabs: false
- }
- },this.dialogConfig)
- );
-
- this.dialog.addKeyListener(27, this.dialog.hide, this.dialog);
- if (this.itemList.indexOf('save_send') > -1 ) {
- this.dialog.addButton(_T["c5f95205dd78ae006d052009aa6142f8"], this.saveSend, this);
- }
-
-
- this.dialog.addButton(_T["687a326482448749613f378d040f6ef6"], this.dialog.hide, this.dialog);
-
-
-
- this.dialog.addButton(_T["7033b8924378a2098ecf784128d96125"], this.save, this);
- this.layout = this.dialog.getLayout();
- this.layout.beginUpdate();
-
-
- this.form = new Ext.form.Form({
- labelWidth: 120,
- listeners : {
- actionfailed : function(f, C) {
- B.dialog.el.unmask();
-
- Pman.standardActionFailed(f,C);
-
- },
- actioncomplete: function(f, D) {
- B.dialog.el.unmask();
- if (D.type == 'load') {
- B.data = D.result.data;
-
- }
-
-
- if ((D.type == 'load') || (D.type == 'setdata')) {
- var data = B.data;
-
-
-
- if (B.form.findField('company_id') && B.form.findField('company_id').setFromData) {
- B.form.findField('company_id').setFromData( data.company_id ? {
- id : data.company_id,
- name : data.company_id_name,
- remarks: data.company_id_remarks,
- address: data.company_id_address,
- tel: data.company_id_tel,
- fax: data.company_id_fax,
- email: data.company_id_email
- } : { id: 0, name : '' });
- }
-
-
- if (B.form.findField('office_id') && B.form.findField('office_id').setFromData) {
-
-
- B.form.findField('office_id').setFromData(data.office_id ? {
- id: data.office_id,
- name: data.office_id_name,
- remarks: data.office_id_remarks,
- address: data.office_id_address,
- tel: data.office_id_tel,
- fax: data.office_id_fax,
- email: data.office_id_email
-
-
- } : { id: 0, name: '' });
-
- }
- if (B.form.findField('project_id')) {
- B.form.findbyId('project_id_fs').setExpand(data.project_id ? true: false);
-
-
- B.form.findField('project_id').setFromData(data.project_id ?{
- id : data.project_id,
- code : data.project_id_code
- } : { id: 0, code :'' } );
- }
-
-
- if (this.type == 'staff') {
- B.form.findField('passwd1').allowBlank = false;
- B.form.findField('passwd2').allowBlank = false;
- if (data.id > 0) {
- B.form.findField('passwd1').allowBlank = true;
- B.form.findField('passwd2').allowBlank = true;
- }
-
- }
- return;
- }
-
- if (D.type == 'submit') {
- B.dialog.hide();
-
-
-
- if (B.callback) {
- B.callback.call(this, D.result.data);
- }
- if (B.sendAfterSave) {
- D.result.data.rawPasswd = B.form.findField('passwd1').getValue();
- B.sendIntro([ D.result.data ], _T["98ca94191386d0d2cd58bd272d1df5d7"]);
- }
-
- return;
- }
-
- }
- }
-
-
- });
- this.loadItemTypes();
- Roo.each(this.itemList, function(il) {
- if (typeof(il) != 'object') {
- B.form.addxtype(B.itemTypes[il]);
- return true;
- }
-
- B.form.addxtype(Roo.apply(il, B.itemTypes[il.name]));
-
- });
- var ef = this.dialog.getLayout().getEl().createChild({tag: 'div'});
- ef.dom.style.margin = 10;
-
- this.form.render(ef.dom);
-
- var vp = this.dialog.getLayout().add('center', new Ext.ContentPanel(ef, {
- autoCreate : true,
-
-
- width: 250,
- maxWidth: 250,
- fitToFrame:true
- }));
-
-
-
-
- this.layout.endUpdate();
-
- },
-
-
-
- loadItemTypes : function()
- {
- var C = this;
- this.itemTypes = {
- company_id_name_ro : {
- name : 'company_id_name',
- fieldLabel : _T["92e1985e19c2bb5d9556ac7ba52d5a7a"],
- value : '',
- xtype : 'TextField',
- readOnly : true,
- width : 300
- },
-
- company_id_name : {
-
- xtype: 'ComboBoxAdder',
- fieldLabel: _T["92e1985e19c2bb5d9556ac7ba52d5a7a"],
- name : 'company_id_name',
- selectOnFocus:true,
- qtip : _T["276038b1ea02816633ab56c087ab5e8b"],
- allowBlank : false,
- width: 300,
-
- store: {
- xtype : 'Store',
-
- proxy:{
- xtype: 'HttpProxy',
- url: baseURL + '/Roo/Companies.html',
- method: 'GET'
- },
- reader: Pman.Readers.Companies,
- listeners : {
- beforeload : function(st,o)
- {
-
- o.params.isOwner = 0;
- },
- loadexception : Pman.loadException
-
- },
- sortInfo: {
- field: 'name', direction: 'ASC'
- }
- },
- displayField:'name',
- valueField : 'id',
- hiddenName: 'company_id',
- typeAhead: true,
- forceSelection: true,
-
- triggerAction: 'all',
- tpl: new Ext.Template(
- '<div class="x-grid-cell-text x-btn button">',
- '<b>{name}</b> {address}',
- '</div>'
- ),
- queryParam: 'query[name]',
- loadingText: _T["4b59409465457ad433c029640bf1a2c5"],
- listWidth: 400,
-
- minChars: 2,
- pageSize:20,
- listeners : {
- adderclick : function()
- {
- var cb = this;
- Pman.Dialog.Companies.show( { id: 0 }, function(D) {
- cb.setFromData(D);
- });
- }
- }
-
-
-
-
- },
- office_id_name_ro : {
- name : 'office_id_name',
- fieldLabel : _T["be407624d99fa1d3edd7ff59c079dd62"],
- value : '',
- xtype : 'TextField',
- readOnly : true,
- width : 300
- },
-
- office_id_name : {
-
- xtype: 'ComboBoxAdder',
- fieldLabel: _T["b41f06c5d4aa97be01660b5033f3c0b9"],
- name : 'office_id_name',
- selectOnFocus:true,
- qtip : _T["99667c31cbee3c1649a9abfba6f76f5f"],
- allowBlank : true,
- width: 300,
-
- store: {
- xtype : 'Store',
-
- proxy: {
- xtype : 'HttpProxy',
- url: baseURL + '/Roo/Office.html',
- method: 'GET'
- },
- reader: Pman.Readers.Office,
- listeners : {
- beforeload : function(st,o)
- {
-
- var D = C.form.findField('company_id').getValue();
- o.params.company_id = D;
- },
- loadexception : Pman.loadException
-
- },
- sortInfo: {
- field: 'name', direction: 'ASC'
- }
- },
- listeners : {
- adderclick : function()
- {
- var cb = this;
-
-
- var E = false;
- var F = false;
- if (C.type == 'new') {
- F = C.form.findField('company_id').lastData;
- if (!F.id ) {
- Ext.MessageBox.alert(_T["7825faf6d798725b4f9c36122dc0d78f"], _T["e81e0305bf7b9c0bff38b1bd4113a94b"]);
- return false
- }
-
-
- E = {
- company_id : F.id ,
- company_id_name: F.name,
- address: F.address,
- phone: F.tel,
- fax: F.fax,
- email: F.email
- };
-
- } else {
- F = C.data;
- E = {
- company_id : F.company_id,
- company_id_name: F.company_id_name,
- address: F.company_id_address,
- phone: F.company_id_tel,
- fax: F.company_id_fax,
- email: F.company_id_email
- }
- }
-
-
-
-
-
- Pman.Dialog.Office.show(E, function(G) {
- cb.setFromData(G);
- });
- },
- beforequery : function (qe) {
- var G = C.form.findField('company_id').getValue();
- if (G < 1 ) {
- Ext.MessageBox.alert(_T["7825faf6d798725b4f9c36122dc0d78f"], _T["e81e0305bf7b9c0bff38b1bd4113a94b"]);
- return false;
- }
- }
- },
- displayField:'name',
- valueField : 'id',
- hiddenName: 'office_id',
- typeAhead: true,
- forceSelection: true,
-
- triggerAction: 'all',
- tpl: new Ext.Template(
- '<div class="x-grid-cell-text x-btn button">',
- '<b>{name}</b> {address}',
- '</div>'
- ),
- queryParam: 'query[name]',
- loadingText: _T["4b59409465457ad433c029640bf1a2c5"],
- listWidth: 400,
-
- minChars: 2,
- pageSize:20
-
-
- },
- name : {
- name : 'name',
- fieldLabel : _T["43a33d905d2c47dcd5afccb8d6c5c9ec"],
- value : '',
- allowBlank : false,
- qtip : _T["801f9098abec829acfaad24d9c38acf1"],
- xtype : 'TextField',
- width : 300
- },
- role : {
- name : 'role',
- fieldLabel : _T["976cb754f8a3120a0d8ddecc7dad70b3"],
- value : '',
- allowBlank : true,
- qtip : _T["36e08fc5b447ea57d5f9801a0a594de8"],
- xtype : 'TextField',
- width : 300
- },
-
- phone : {
- name : 'phone',
- fieldLabel : _T["8ecda72b47a4d87945396f1deb3a4e2b"],
- value : '',
- allowBlank : true,
- qtip : _T["60c2576c3bd6fce9593dfafa60d5dc71"],
- xtype : 'TextField',
- width : 300
- },
- fax : {
-
- name : 'fax',
- fieldLabel : _T["6eab94585302a1eb047d8ad46a822fe1"],
- value : '',
- allowBlank : true,
- qtip : _T["bbc9b7422ae486331486a0734c399109"],
- xtype : 'TextField',
- width : 300
- },
- email : {
- name : 'email',
- fieldLabel : _T["fef6c4502e830f3cb17ceda089079d08"],
- value : '',
- allowBlank : true,
- qtip : _T["b9b189c9b68fd2072e2937f60042e970"],
- xtype : 'TextField',
- width : 300
- },
- bulklist: {
- name : 'bulklist',
- fieldLabel : _T["598d3e15de6c0edc42bbb12bba56848c"],
- value : '',
- allowBlank : false,
- qtip : _T["56270c6137713c24a973c4239ef10a8c"],
- xtype : 'TextArea',
- width : 300,
- height: 200
- },
-
-
- email_req : {
- name : 'email',
- fieldLabel : _T["fef6c4502e830f3cb17ceda089079d08"],
- value : '',
- allowBlank : false,
- qtip : _T["b9b189c9b68fd2072e2937f60042e970"],
- xtype : 'TextField',
- width : 300
- },
- passwd1 : {
- name : 'passwd1',
- fieldLabel : _T["024116eeefc851698f4381072c88c988"],
- value : '',
- allowBlank : true,
- inputType: 'password',
- xtype : 'SecurePass',
- width : 220,
- imageRoot : rootURL + '/Pman/templates/images'
- },
- passwd2 : {
-
- name : 'passwd2',
- fieldLabel : _T["9ea81314e83737179ff499c00215e349"],
- value : '',
- allowBlank : true,
- inputType: 'password',
- xtype : 'TextField',
- width : 220
- },
- project_id_fs : {
- xtype : 'FieldSetEx',
- name: 'project_id_fs',
- value: 0,
- labelWidth: 100,
- expanded: false,
- style: 'width:420px;',
- legend : _T["28d4e53cb89a8406eaacfece36ecfbea"],
- items : [
- Pman.Std.project_id({
- width: 300,
- fieldLabel : _T["b5506f1d5c8fcd78b22b830ce30a377f"],
- allowBlank : true
- }),
- {
- xtype: 'ComboBox',
- name : 'action_type_str',
- selectOnFocus:true,
- qtip : _T["fac109c69eeb67ebda3c5e40393bcb9b"],
- fieldLabel : _T["82c0f8b8dd0cb58b397ee9d6f633749e"],
-
- allowBlank : true,
- width: 50,
-
-
- store: new Ext.data.SimpleStore({
-
- fields: [ 'code', 'desc' ],
- data: [[ 'ACTION_REQUIRED', _T["035ee8612761bb1546093a1b22451b67"]] , [ 'NOTIFY', _T["4545094571d2bd9ce3dfc20783cf3dbc"]] ]
- }),
- displayField:'desc',
- editable : false,
- valueField : 'code',
- hiddenName: 'action_type',
- value : 'ACTION_REQUIRED',
- forceSelection: true,
- mode: 'local',
- triggerAction: 'all'
-
-
-
-
-
-
- }
- ]
- },
-
- id : { name : 'id', value : '', xtype : 'Hidden' },
- save_send : { name : '_save_send', value : 0, xtype : 'Hidden' },
- active : { name : 'active', value : 1, xtype : 'Hidden' },
- company_id : { name : 'company_id', value : '', xtype : 'Hidden' },
- company_id_email : { name : 'company_id_email', value : '', xtype : 'Hidden' },
- company_id_address : { name : 'company_id_address', value : '', xtype : 'Hidden' },
- company_id_tel : { name : 'company_id_tel', value : '', xtype : 'Hidden' },
- company_id_fax : { name : 'company_id_fax', value : '', xtype : 'Hidden' },
- project_id_addto : { name : 'project_id_addto', value : '', xtype : 'Hidden' }
- };
-
- },
-
- saveSend : function(bt, e)
- {
- this.save(bt,e, 1)
- },
- sendAfterSave : 0,
- save : function(bt, e, D)
- {
-
- this.sendAfterSave = D || 0;
-
- if (this.form.findField('bulklist')) {
- this.saveBulk();
- return;
-
- }
- if (!this.form.findField('company_id').getValue()) {
- Ext.MessageBox.alert(_T["7825faf6d798725b4f9c36122dc0d78f"], _T["4e8097f84abcc6d92ca69656d0e94024"]);
- return;
- }
-
- if (this.form.findField('passwd1')) {
-
- var p1 = this.form.findField('passwd1').getValue();
- var p2 = this.form.findField('passwd2').getValue();
-
- if (this.sendAfterSave && !p1.length) {
- Ext.MessageBox.alert(_T["7825faf6d798725b4f9c36122dc0d78f"], _T["3a2644a946cf95a21e5890507232305f"]);
- return;
- }
-
- if (Pman.Login.authUser.id < 0 && !p1.length) {
- Ext.MessageBox.alert(_T["7825faf6d798725b4f9c36122dc0d78f"], _T["c9f36f7b1c27b424e71ce6c66a2f000e"]);
- return;
- }
-
-
- if (p1.length || p2.length) {
- if (p1 != p2) {
- Ext.MessageBox.alert(_T["7825faf6d798725b4f9c36122dc0d78f"], _T["f202ec7143eb64a7694663d5d795972b"]);
- return;
- }
- }
-
-
- }
-
- if (this.form.findField('project_id')) {
- if (!this.form.findbyId('project_id_fs').expanded) {
- this.form.findField('project_id').setFromData({
- id : 0,
- code : ''
- });
- }
- }
-
- this.dialog.el.mask(_T["b57f7c3a947d7a7a24dcce08a1f789ec"]);
- this.form.doAction('submit', {
- url: baseURL + '/Roo/Person.html',
- method: 'POST',
- params: {
- _id: this._id ,
- ts : Math.random()
- }
- });
- },
-
-
-
- show: function (E, F)
- {
-
- this.callback = F;
- this._id = E.id;
- this.data = E;
- this.create();
- this.form.reset();
- if (E._fetch) {
- this.dialog.show();
- this.dialog.el.mask(_T["ecb6cc539899477d30b822eab4f51b57"]);
- this.form.doAction('load', {
- url: baseURL + '/Roo/Person.html',
- method: 'GET',
- params: {
- _id: this._id ,
- _ts : Math.random()
- }
- });
-
- return;
- } else {
- this.form.setValues(E);
- }
-
- this.form.fireEvent('actioncomplete', this.form,{
- type : 'setdata',
- data: E
- });
-
- this.dialog.show();
-
-
- },
-
- saveBulk: function() {
-
-
- if (!this.form.findField('company_id').getValue()) {
- Roo.MessageBox.alert(_T["7825faf6d798725b4f9c36122dc0d78f"], _T["6c755092c6556392d8f8589ea57ed32e"]);
- return;
- }
-
- var G = [];
- var H = this;
-
- Roo.MessageBox.confirm(_T["f81f0fdf4c6384f98a5d1f49ffd0ebe3"], _T["0734055957ed2deb78318855e001f072"],
- function(yn) {
- var pw = 1;
-
- if (yn != 'yes') {
- pw = 0;
- }
-
- Roo.each(H.form.findField('bulklist').getValue().split(_T["2b80fb0dc406c89322d30ed0c0f6150b"]), function(v) {
- if (!v.length || !v.replace(new RegExp(' ', 'g'), '').length) {
- return;
- }
-
- G.push({
- id: 0,
- email : v,
- company_id : H.form.findField('company_id').getValue(),
- office_id : H.form.findField('office_id').getValue(),
- active : 1,
- _create : 1,
- _createPasswd : pw
-
- })
- });
- if (!G.length) {
- Roo.MessageBox.alert(_T["7825faf6d798725b4f9c36122dc0d78f"], _T["453b606630064afeccae473d15cb21f1"]);
- return;
- }
-
- H.dialog.hide();
- H.sendIntro(G, _T["ffe42f94e27e5228d3d2320e16dfb61b"], H.callback)
- }
- );
-
-
-
-
-
-
- },
-
-
- sendIntro : function(ar, I, J) {
-
-
- var i =0;
-
- Roo.MessageBox.show({
- title: _T["d4efe6bd99e2f9dca237692425cd1e37"],
- msg: I,
- width:350,
- progress:true,
- closable:false
- });
-
-
- var K = this;
- var L = function ()
- {
- if (i == ar.length) {
- Roo.MessageBox.hide();
- Roo.MessageBox.alert(_T["78800f89af27b724063900f2ac603ea8"], _T["4f53be722b07293542247cc405232a69"] + I);
- if (J) {
- J.call(this, false);
- }
- return;
- }
-
- Roo.MessageBox.updateProgress(
- (i+1)/ar.length, I + _T["b3d5fbd734ec40cdb88c7e544b737e57"] + ar[i].email
- );
-
-
- var c = ar[i];
- i++;
- Pman.request({
- url : baseURL+'/Core/SendIntro.html',
- method : 'POST',
- params: c,
- success : function(M, N) {
- L();
- },
- failure: function()
- {
- Roo.MessageBox.show({
- title: _T["d4efe6bd99e2f9dca237692425cd1e37"],
- msg: I,
- width:350,
- progress:true,
- closable:false
- });
-
- L();
- }
-
- });
-
- };
- L();
-
-
-
- }
-
-};
-
-
-
-
-
-
-Pman.on('beforeload', function() {
-
-
-
- Pman.Dialog.Person = new Pman.Dialog.PersonEditor({
- type : 'edit2',
- dialogConfig : {
- title: _T["3e8788f13c62d5400e2eef9ce61ff6d6"],
- height: 400
-
- },
- itemList : [
-
- 'company_id_name_ro',
- 'office_id_name_ro',
- 'name','role', 'phone', 'fax', 'email',
- 'id', 'office_id', 'company_id',
-
-
- 'company_id_email','company_id_address','company_id_tel','company_id_fax'
- ]
- });
-});
-
-
-
-
-
-
-Pman.on('beforeload', function() {
-
-
- Pman.Dialog.PersonNew = new Pman.Dialog.PersonEditor({
- type : 'new',
- dialogConfig : {
- title: _T["aacd89f134545118f60a671de60913d3"],
- height: 350
- },
- itemList : [
- 'company_id_name',
- 'office_id_name',
- 'name','role', 'phone', 'fax', 'email',
- 'project_id_fs',
- 'id',
- 'company_id_email',
- 'company_id_address','company_id_tel','company_id_fax',
- 'project_id_addto'
-
- ]
- });
-});
-
-
-
-
-
-
-Pman.on('beforeload', function() {
-
- Pman.Dialog.PersonStaff = new Pman.Dialog.PersonEditor({
- type : 'staff',
- dialogConfig : {
- title: _T["386f61f04d35fedb1ab564f275a0cc37"]
- },
- itemList : [
-
-
- 'office_id_name',
- 'name','role', 'phone', 'fax', 'email_req',
- 'passwd1', 'passwd2',
-
- 'id', 'office_id', 'company_id',
- 'active',
-
- 'company_id_email','company_id_address','company_id_tel','company_id_fax'
- ]
- });
-
-
-
-});
-
-
-
-
-Pman.Dialog.Projects = {
- dialog : false,
- form : false,
- create: function()
- {
- if (this.dialog) {
- return;
- }
-
-
- this.dialog = new Ext.LayoutDialog(Ext.get(document.body).createChild({tag:'div'}), {
- autoCreated: true,
- title: _T["59222ad07bc6410bf27eab7d035b409d"],
- modal: true,
- width: 450,
- height: 450,
- shadow:true,
- minWidth:200,
- minHeight:180,
-
- closable: false,
- draggable: false,
- center: {
- autoScroll:false,
- titlebar: false,
-
- hideTabs: true,
- closeOnTab: true,
- alwaysShowTabs: false
- }
- });
- this.dialog.addKeyListener(27, this.dialog.hide, this.dialog);
- this.dialog.addButton(_T["0e8ccf88135bae007b5cff5837e3e197"], this.dialog.hide, this.dialog);
-
- this.dialog.addButton(_T["d825914fad6e57c9d1acac55bc74f464"], this.save, this);
- this.layout = this.dialog.getLayout();
- this.layout.beginUpdate();
-
- var dg = Pman.Dialog.Projects;
-
- this.form = new Ext.form.Form({
- labelWidth: 100 ,
- listeners : {
- actionfailed : function(f, A) {
- dg.dialog.el.unmask();
-
- Pman.standardActionFailed(f,A);
-
- },
- actioncomplete: function(f, B) {
- dg.dialog.el.unmask();
-
-
-
-
- if (B.type == 'load') {
-
- dg.data = B.result.data;
-
- return;
- }
-
-
- if (B.type == 'submit') {
- dg.dialog.hide();
- if (dg.callback) {
- dg.callback.call(this, B.result.data);
- }
- return;
- }
-
- }
- }
-
-
-
-
- });
-
- this.form.addxtype.apply(this.form,[
-
- {
- name : 'code',
- fieldLabel : _T["f1a3e388543d7a8d39f1a3d4ade58b94"],
- value : '',
- allowBlank : false,
- qtip : _T["9384bc850b628f21d964769bd7d13e44"],
- xtype : 'TextField',
- width : 100
- },
- {
- name : 'name',
- fieldLabel : _T["2e6569fe7187cf7b776eebf79012c19c"],
- value : '',
- allowBlank : true,
- qtip : _T["be3b8a3bb525b99922adf15223852b6a"],
- xtype : 'TextField',
- width : 300
- },
- {
-
- xtype: 'ComboBox',
- name : 'type_desc',
- selectOnFocus:true,
- qtip : _T["7ca882603340513c5a17a92e2ba98140"],
- fieldLabel : _T["7ca882603340513c5a17a92e2ba98140"],
-
- allowBlank : false,
- width: 200,
-
-
- store: new Ext.data.SimpleStore({
-
- fields: [ 'code', 'desc' ],
- data: Pman.Dialog.Projects.getTypes()
- }),
- displayField:'desc',
- editable : false,
- valueField : 'code',
- hiddenName: 'type',
- typeAhead: true,
- forceSelection: true,
- mode: 'local',
- triggerAction: 'all'
-
-
-
-
-
-
- },
-
- {
-
- xtype: 'ComboBoxAdder',
- fieldLabel: _T["ff40386a43ccfe9066f7ebe51992cd86"],
- name : 'client_id_name',
- selectOnFocus:true,
- qtip : _T["720eb6ec8a30c82c92847a11ee6d32e6"],
- allowBlank : true,
- width: 277,
-
- store: new Ext.data.Store({
-
- proxy: new Ext.data.HttpProxy({
- url: baseURL + '/Roo/Companies.html',
- method: 'GET'
- }),
- reader: Pman.Readers.Companies,
- listeners : {
- loadexception : Pman.loadException
- }
- }),
- displayField:'name',
- valueField : 'id',
- hiddenName: 'client_id',
- typeAhead: true,
- forceSelection: true,
-
- triggerAction: 'all',
- tpl: new Ext.Template(
- '<div class="x-grid-cell-text x-btn button">',
- '<b>{name}</b> {address}',
- '</div>'
- ),
- queryParam: 'query[name]',
- loadingText: _T["4a17dd69fb7066cf43bf7c5f3d9e4cc6"],
- listWidth: 400,
-
- minChars: 2,
- pageSize:20,
-
- listeners : {
- adderclick : function()
- {
- var cb = this;
- Pman.Dialog.Companies.show( { id: 0 }, function(A) {
- cb.setFromData(A);
- });
- },
- blur : function(f) {
- if (!f.el.getValue().length) {
- this.setFromData({
- id: 0,
- name : _T["bd58983405ed76181a8d0ce7223d2780"]
- });
- }
- }
- }
-
-
- },
-
- {
-
- xtype: 'ComboBox',
- fieldLabel: _T["0699fc5c5d74dce96c828c6e578ece63"],
- name : 'team_id_name',
- selectOnFocus:true,
- qtip : _T["45e0394905808bcc80c34202748ddb13"],
- allowBlank : true,
- width: 300,
-
- store: new Ext.data.Store({
-
- proxy: new Ext.data.HttpProxy({
- url: baseURL + '/Roo/Groups.html',
- method: 'GET'
-
- }),
- reader: Pman.Readers.Groups,
- listeners : {
- beforeload: function(g, o) {
- o.params = o.params ? o.params : {};
- o.params.type = 1;
- o.params['query[group_pulldown]'] = 1;
-
- },
- loadexception : Pman.loadException
-
- }
- }),
- displayField:'name',
- valueField : 'id',
- hiddenName: 'team_id',
- typeAhead: true,
- forceSelection: true,
-
- triggerAction: 'all' ,
- queryParam: 'query[name]',
- loadingText: _T["4a17dd69fb7066cf43bf7c5f3d9e4cc6"],
-
-
- minChars: 2,
-
-
- listeners : {
- blur : function(f) {
- if (!f.el.getValue().length) {
- this.setFromData({
- id: 0,
- name : _T["bd58983405ed76181a8d0ce7223d2780"]
- });
- }
- }
- }
-
-
- },
-
-
-
-
-
- {
- name : 'file_location',
- fieldLabel : _T["b72ffe66d7fb5278bc886ee23dbda9fa"],
- value : '',
- qtip : _T["4206f45d33f6d7d12e9e7b6efc86e0de"],
- allowBlank : true,
- xtype : 'TextField',
- width : 300
- },
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {
- name : 'remarks',
- fieldLabel : _T["59242789e33d13385e7775bc7421464e"],
- value : '',
- allowBlank : true,
- qtip : _T["0ebe06a05911b24af87a933ca81882a0"],
- xtype : 'TextArea',
- width : 300,
- height : 100
- },
-
-
- {
- xtype : 'FieldSet',
- legend: 'Opened',
- style: 'width:393px;padding:0 0 2 10;',
- items : [
- {
- name : 'open_date',
- fieldLabel : _T["00f5ccf184f1ff533931bde4424040b2"],
- value : '',
- allowBlank : true,
- qtip : _T["b90aa2ba8fe6d79a85c11ef4034f1f86"],
- xtype : 'DateField',
- altFormats : 'Y-m-d|d/m/Y',
- width : 100,
- format: 'd/m/Y'
- },
-
-
-
- {
-
- xtype: 'ComboBox',
- fieldLabel: _T["c2257f446d410ea7a44b2f3fd68baa4a"],
- name : 'open_by_name',
- selectOnFocus:true,
- qtip : _T["5fcc9c08873869529a4c0f640c34b803"],
- allowBlank : true,
- width: 250,
-
- store: new Ext.data.Store({
-
- proxy: new Ext.data.HttpProxy({
- url: baseURL + '/Roo/Person.html',
- method: 'GET'
- }),
- reader: Pman.Readers.Person,
- listeners : {
- beforeload : function(st,o)
- {
-
-
- o.params.company_id = Pman.Login.authUser.company_id * 1;
-
-
- },
- loadexception : Pman.loadException
-
- }
- }),
-
-
- displayField:'name',
- valueField : 'id',
- hiddenName: 'open_by',
- typeAhead: true,
- forceSelection: true,
- doForce : function(){
- if(this.el.dom.value.length > 0){
- this.el.dom.value =
- this.lastSelectionText === undefined ? _T["bd58983405ed76181a8d0ce7223d2780"] : this.lastSelectionText;
- this.applyEmptyText();
- if (!this.el.dom.value.length) {
- this.setFromData({ id: 0, name: '----' });
- }
- }
- },
-
-
- triggerAction: 'all',
- tpl: new Ext.Template(
- '<div class="x-grid-cell-text x-btn button">',
- '<b>{name}</b> {role}',
- '</div>'
- ),
- queryParam: 'query[name]',
- loadingText: _T["4a17dd69fb7066cf43bf7c5f3d9e4cc6"],
- listWidth: 300,
-
- minChars: 2,
- pageSize:20
-
- }
- ]
-
- },
- {
- name : 'id',
- value : '',
- xtype : 'Hidden'
-
- }
- ]);
- var ef = this.dialog.getLayout().getEl().createChild({tag: 'div'});
- ef.dom.style.margin = 10;
-
- this.form.render(ef.dom);
-
- var vp = this.dialog.getLayout().add('center', new Ext.ContentPanel(ef, {
- autoCreate : true,
-
-
- width: 250,
- maxWidth: 250,
- fitToFrame:true
- }));
-
-
-
-
- this.layout.endUpdate();
- },
- _id : 0,
- show : function(A, B)
- {
- this.callback= B;
- this._id = A.id;
- this.data = A;
- this.create();
- this.form.reset();
- this.form.setValues(A);
- if (A.id) {
-
- this.form.findField('client_id').setFromData({
- id: A.client_id,
- name: A.client_id_name
- });
- this.form.findField('team_id').setFromData({
- id: A.team_id,
- name: A.team_id_name
- });
- this.form.findField('open_by').setFromData({
- id: A.open_by,
- name: A.open_by_name
- });
- }
-
- this.dialog.show();
-
-
- },
- save : function()
- {
- this.form.doAction('submit', {
- url: baseURL + '/Roo/Projects.html',
- method: 'POST',
- params: {
- _id: this._id ,
- ts : Math.random()
- }
- });
- },
- getTypes: function()
- {
-
- return [
- [ 'U' , _T["0f67962c957fe1a78b2abbcdd1959fab"] ],
- [ 'P' , _T["885cfd841387dbb74b3b05d5ab44ac3c"] ],
- [ 'C' , _T["fb3df23fb6c604eb3f9f5a6195be8b08"] ],
- [ 'N' , _T["e51c6929125db77ad4bc99165f315a54"] ],
- [ 'X' , _T["de3791961a26ccaef609480733d9e29e"] ]
-
- ];
- },
-
-
-
-
-};
-
-
-
-
-
-
-Pman.I18n = {
-
-
-
- listToNames: function (A, B)
- {
- var C = [];
- var D = this;
- var cl = B.split(',');
- Roo.each(cl , function(c) {
- C.push(D.toName(A, c));
- });
- return C.join(', ');
- },
-
-
- toName: function(E, F)
- {
- var G = F;
- var H = Pman.Login.authUser.lang || 'en';
- if (F.indexOf('_') > -1) {
- var clang = F.split('_').shift();
- var cc = F.split('_').pop();
- return this.toName('l', clang) + ' (' + cc + ')';
- }
-
-
-
- Roo.each(Pman.I18n.Data[H][E], function(d) {
- if (d.code == F) {
- G = d.title;
- return false;
- }
- });
- return G;
-
- },
-
-
- listToObjects: function (I, J)
- {
- var K = [];
- var L = this;
- if (!J.length) {
- return K;
- };
- var cl = J.split(',');
- Roo.each(cl , function(c) {
- K.push({
- code : c,
- title : L.toName(I,c)
- })
- });
- return K;
- },
-
-
-
- reader : {
- root : 'data',
- totalProperty : 'total',
- id : 'code',
- xtype : 'JsonReader',
- fields : [
- 'code',
- 'title'
- ]
- },
-
-
-
-
-
-
- dataToProxy : function(M)
- {
- var N = Pman.Login.authUser.lang || 'en';
- return Pman.I18n.Data[N][M];
- },
-
-
-
- countryStore : function() { return {
-
-
- xtype: 'Store',
- proxy: {
- xtype: 'HttpProxy',
- url: baseURL + '/I18N/Country.html',
- method: 'GET'
- },
-
- reader: Pman.I18n.reader,
- listeners : {
-
- loadexception : Pman.loadException
-
- },
- remoteSort: false,
- sortInfo: {
- field: 'title', direction: 'ASC'
- }
-
- }},
-
- languageStore: function() {return {
-
- xtype: 'Store',
- proxy: {
- xtype: 'HttpProxy',
- url: baseURL + '/I18N/Lang.html',
- method: 'GET'
- },
-
- reader: Pman.I18n.reader,
- listeners : {
-
- loadexception : Pman.loadException
-
- },
- remoteSort: false,
- sortInfo: {
- field: 'title', direction: 'ASC'
- }
- }},
-
- currencyStore: function() {return {
-
- xtype: 'Store',
- proxy: {
- xtype: 'HttpProxy',
- url: baseURL + '/I18N/Currency.html',
- method: 'GET'
- },
-
- reader: Pman.I18n.reader,
- listeners : {
-
- loadexception : Pman.loadException
-
- },
- remoteSort: false,
- sortInfo: {
- field: 'title', direction: 'ASC'
- }
- }},
-
- country: function(O) {
- var P = this;
- O = O || {};
- return Roo.apply({
-
- name : 'country_title',
- hiddenName : 'country',
- width : 290,
- listWidth : 300,
- fieldLabel : _T["c1d17a6224927a2a9fedfe19d7a211c3"],
- allowBlank : false,
-
-
- qtip : _T["a11dac8be1a6f587eedf4a1c1e2699ae"],
-
- value : '',
-
- xtype : 'ComboBox',
- store: this.countryStore(),
- displayField:'title',
- valueField : 'code',
- typeAhead: false,
- editable: false,
-
- triggerAction: 'all',
-
- selectOnFocus:true
-
- }, O);
- },
-
- language: function(Q) {
- var R = this;
- Q = Q || {};
- return Roo.apply({
-
-
- name : 'language_title',
- hiddenName : 'language',
- width : 290,
- listWidth : 300,
- fieldLabel : _T["9bc63702145bdb09708fa539aeefd725"],
- allowBlank : false,
-
-
- qtip : _T["abbb23b334572407b19d843b3dfa3ee5"],
-
- value : '',
-
- xtype : 'ComboBox',
- store: this.languageStore(),
- displayField:'title',
- valueField : 'code',
-
- typeAhead: false,
- editable: false,
-
- triggerAction: 'all',
-
- selectOnFocus:true
-
- }, Q);
- },
-
- currency: function(S) {
- var T = this;
- S = S || {};
- return Roo.apply({
-
- name : 'currency_title',
- hiddenName : 'currency',
- width : 290,
- listWidth : 300,
- fieldLabel : _T["1715e2ee8fbb45f3bb264d9806719b71"],
- allowBlank : false,
-
-
- qtip : _T["09e12895bf6d4b9974098883faa51a0b"],
-
- value : '',
-
- xtype : 'ComboBox',
- store: this.currencyStore(),
- displayField:'code',
- valueField : 'code',
- typeAhead: false,
- editable: false,
-
- triggerAction: 'all',
-
- selectOnFocus:true,
- tpl: new Ext.Template(
- '<div class="x-grid-cell-text x-btn button">',
- '{title} ({code})</b>',
- '</div>'
- )
-
- }, S);
- },
-
- languageList : function(U) {
- U = U || {};
-
- return Roo.apply({
-
- name : 'language',
-
- fieldLabel : _T["9cdc0fbfc6a23315187fe5cea6cd9c59"],
- idField : 'code',
- nameField: 'title',
- renderer : function(d) {
- return String.format('{0}', d.title );
- },
-
-
- xtype: 'ComboBoxLister',
- displayField:'title',
- value : '',
-
- qtip : _T["3b073f6f35aed6785dbccdf6ea9ecd13"],
- selectOnFocus:true,
- allowBlank : true,
- width: 150,
- boxWidth: 300,
-
- store: this.languageStore(),
-
- editable: false,
-
- forceSelection: true,
-
- triggerAction: 'all',
- tpl: new Ext.Template(
- '<div class="x-grid-cell-text x-btn button">',
- '{title}</b>',
- '</div>'
- ),
- queryParam: 'query[name]',
- loadingText: _T["0202dbdb1d198fc99ff5e6a12dc1d1ff"],
- listWidth: 400,
-
- minChars: 2,
-
- setList : function(ar) {
- var V = this;
- Roo.each(ar, function(a) {
- V.addItem(a);
- });
- },
- toList : function() {
- var W = [];
- this.items.each(function(a) {
- W.push(a.data);
- });
- return W;
- }
-
-
- }, U);
- },
-
- countryList : function(V) {
- V = V || {};
-
-
- return Roo.apply({
-
- name : 'countries',
- fieldLabel : _T["4e58ecc198012e7ff1b9c77d4617498f"],
- idField : 'code',
- nameField: 'title',
- renderer : function(d) {
- return String.format('{0}', d.title );
- },
-
-
- xtype: 'ComboBoxLister',
- displayField:'title',
- value : '',
-
- qtip : _T["b9cd67022614720c2f168ce18ab32b1c"],
- selectOnFocus:true,
- allowBlank : true,
- width: 150,
- boxWidth: 300,
-
- store: this.countryStore(),
-
- editable: false,
-
- forceSelection: true,
-
- triggerAction: 'all',
- tpl: new Ext.Template(
- '<div class="x-grid-cell-text x-btn button">',
- '{title}</b>',
- '</div>'
- ),
- queryParam: 'query[name]',
- loadingText: _T["0202dbdb1d198fc99ff5e6a12dc1d1ff"],
- listWidth: 400,
-
- minChars: 2,
-
- setList : function(ar) {
- var W = this;
- Roo.each(ar, function(a) {
- W.addItem(a);
- });
- },
- toList : function() {
- var X = [];
- this.items.each(function(a) {
- X.push(a.data);
- });
- return X;
- }
-
-
- }, V);
- }
-
-
-
-};
-
-
-
-
-
-
-
-
-
-
-
-Pman.Login = new Roo.util.Observable({
-
- events : {
-
- 'render' : true
- },
- disabled : false,
-
- dialog : false,
- form: false,
- haslogo : false,
-
- authUserId: 0,
- authUser: { id : false },
-
- checkFails : 0,
- versionWarn: false,
- sending : false,
-
- onLoad : function()
- {
-
-
-
- if (Roo.get('loading')) {
- Roo.get('loading').remove();
- }
-
- this.switchLang('en');
-
-
- Roo.Ajax.request({
- url: baseURL + '/Login.js',
- params: {
- getAuthUser: true
- },
- method: 'GET',
- success: function(A, B) {
-
- var C = Pman.processResponse(A);
- this.checkFails =0;
- if (!C.success) {
- this.checkFails = 5;
-
- return Pman.Login.failure(A,B);
- }
- if (!C.data.id) {
- return this.show(true);
- }
-
-
-
-
- this.fillAuth(C.data);
- this.checkFails =0;
- Pman.onload();
- },
- failure : Pman.Login.show,
- scope : Pman.Login
-
- });
- },
-
-
- check: function(A)
- {
- if (A) {
- Pman.Login.checkFails++;
- } else {
- Pman.Login.checkFails = 0;
- }
- var B = this;
- if (this.sending) {
-
- if ( Pman.Login.checkFails > 4) {
- Pman.Preview.disable();
- Roo.MessageBox.alert(_T["8391d964e04c0c30d9f19bf036136c8d"],
- _T["4b0bb0bd607983ab0061a86db7fc7ba2"], function() {
- B.sending = false;
- });
- return;
- }
-
-
- B.check.defer(10000, B, [ true ]);
- return;
- }
-
- this.sending = true;
-
- Roo.Ajax.request({
- url: baseURL + '/Login.js',
- params: {
- getAuthUser: true
- },
- method: 'GET',
- success: Pman.Login.success,
- failure : Pman.Login.failure,
- scope : Pman.Login
-
- });
- },
-
-
-
- failure : function (C, D)
- {
- this.authUser = -1;
- this.sending = false;
- var E = Pman.processResponse(C);
-
- if ( Pman.Login.checkFails > 2) {
- Pman.Preview.disable();
- Roo.MessageBox.alert(_T["8391d964e04c0c30d9f19bf036136c8d"], E.errorMsg ? E.errorMsg :
- _T["54242987801741c4105cfa0435d9912e"]);
- return;
- }
-
-
- Pman.Login.check.defer(1000, Pman.Login, [ true ]);
- return;
- },
-
-
- success : function(F, G)
- {
- this.sending = false;
- var H = Pman.processResponse(F);
- if (!H.success) {
- return this.failure(F, G);
- }
- if (!H.data || !H.data.id) {
- return this.failure(F,G);
- }
-
-
- this.fillAuth(H.data);
-
- this.checkFails =0;
- Pman.onload();
- },
-
- fillAuth: function(au) {
- this.startAuthCheck();
- this.authUserId = au.id;
- this.authUser = au;
- this.lastChecked = new Date();
- Pman.fireEvent('authrefreshed', au);
-
-
-
-
- Roo.state.Manager.set('Pman.Login.lang.'+appNameShort, au.lang);
- this.switchLang(au.lang);
-
-
-
- if (this.authUserId < 0) {
- Roo.MessageBox.alert(_T["9eba57f4ad82997225a340c5c140a869"],
- _T["5d5717e963d28007da9511d1416cbc43"]);
- }
-
-
-
-
- },
-
-
- intervalID : false,
-
- lastChecked : false,
-
- startAuthCheck : function()
- {
- if (Pman.Login.intervalID) {
- return false;
- }
-
-
- Pman.Login.intervalID = window.setInterval(function() {
- Pman.Login.check(false);
- }, 120000);
-
-
- },
-
-
- create : function()
- {
- if (this.dialog) {
- return;
- }
- var I = this;
-
- this.dialog = new Roo.LayoutDialog(Roo.get(document.body).createChild({tag:'div'}),
- {
- autoCreated: true,
- title: _T["68156a5e398303b805bd96fbc6b1f8ee"],
- modal: true,
- width: 350,
- height: 230,
- shadow:true,
- minWidth:200,
- minHeight:180,
-
- closable: false,
- draggable: false,
- collapsible: false,
- resizable: false,
- center: {
- autoScroll:false,
- titlebar: false,
-
- hideTabs: true,
- closeOnTab: true,
- alwaysShowTabs: false
- }
-
- });
-
-
-
- this.dialog.addButton(_T["b2d0ea65f8ae06179a40d78e52b7833c"], function()
- {
-
- var n = I.form.findField('username').getValue();
- if (!n.length) {
- Roo.MessageBox.alert(_T["8391d964e04c0c30d9f19bf036136c8d"], _T["9055d707d0388278ceb4f35426316c1b"]);
- return;
- }
-
- Roo.Ajax.request({
- url: baseURL + '/Login.js',
- params: {
- passwordRequest: n
- },
- method: 'POST',
- success: function(J, K) {
-
- var L = Pman.processResponse(J);
- if (!L.success) {
- Roo.MessageBox.alert(_T["8391d964e04c0c30d9f19bf036136c8d"] , L.errorMsg ? L.errorMsg : _T["2409934e0552cdd76753d2c11005b6b5"]);
- return;
- }
-
- Roo.MessageBox.alert(_T["463c573d3aed3795e9e3145f10cd1416"] , _T["de7b06c26e8b5361eb8e33d068dd2ce4"]);
- },
- failure : function() {
- Roo.MessageBox.alert(_T["8391d964e04c0c30d9f19bf036136c8d"] , _T["2409934e0552cdd76753d2c11005b6b5"]);
- }
-
- });
- });
-
- this.dialog.addButton(_T["68156a5e398303b805bd96fbc6b1f8ee"], function()
- {
- Pman.Login.dialog.el.mask(_T["31cfba7708e9535c79660355d0f8accf"]);
- Pman.Login.form.doAction('submit', {
- url: baseURL + '/Login',
- method: 'POST'
- });
- });
- this.layout = this.dialog.getLayout();
- this.layout.beginUpdate();
-
-
-
- this.form = new Roo.form.Form({
- labelWidth: 100 ,
-
- listeners : {
- actionfailed : function(f, J) {
-
-
-
-
-
- Pman.Login.dialog.el.unmask();
- Roo.MessageBox.alert(_T["8391d964e04c0c30d9f19bf036136c8d"], J.result.errorMsg ? J.result.errorMsg :
- _T["c1b8242e54c06ad890a6a091195f7b8e"]);
-
- },
- actioncomplete: function(re, K) {
-
- Roo.state.Manager.set('Pman.Login.username.'+appNameShort, Pman.Login.form.findField('username').getValue() );
- Roo.state.Manager.set('Pman.Login.lang.'+appNameShort, Pman.Login.form.findField('lang').getValue() );
- Pman.Login.fillAuth(K.result.data);
-
- Pman.Login.dialog.hide();
- if (Roo.get('loading-mask')) {
-
- Roo.get('loading-mask').show();
- }
-
-
- Pman.onload();
-
-
-
- }
- }
-
-
-
-
- });
-
-
-
- this.form.add(
-
- new Roo.form.TextField({
- fieldLabel: _T["7e698d4c146d9eefd5dcd10552b18098"],
- name: 'username',
- width:200,
- autoCreate : {tag: _T["23e3b3bf16c1b9ee0b448a20cde1d8a0"], type: _T["356c052df252f5f41bf445742c4a9e92"], size: _T["e5c7255d15759b64bbee6c623c299744"]}
- }),
-
- new Roo.form.TextField({
- fieldLabel: _T["3b9a78188b115fa00e2285cd1047a02e"],
- inputType: 'password',
- name: 'password',
- width:200,
- autoCreate : {tag: _T["23e3b3bf16c1b9ee0b448a20cde1d8a0"], type: _T["356c052df252f5f41bf445742c4a9e92"], size: _T["e5c7255d15759b64bbee6c623c299744"]},
- listeners : {
- specialkey : function(e,ev) {
- if (ev.keyCode == 13) {
- Pman.Login.dialog.el.mask(_T["31cfba7708e9535c79660355d0f8accf"]);
- Pman.Login.form.doAction('submit', {
- url: baseURL + '/Login.json',
- method: 'POST'
- });
- }
- }
- }
- }) ,
- new Roo.form.ComboBox({
- fieldLabel: _T["b2a3486b5105e365dae1a1796390ba42"],
- name : 'langdisp',
- store: {
- xtype : 'SimpleStore',
- fields: ['lang', 'ldisp'],
- data : [
- [ 'en', 'English' ],
- [ 'zh_HK' , '\u7E41\u4E2D' ],
- [ 'zh_CN', '\u7C21\u4E2D' ]
- ]
- },
-
- valueField : 'lang',
- hiddenName: 'lang',
- width: 200,
- displayField:'ldisp',
- typeAhead: false,
- editable: false,
- mode: 'local',
- triggerAction: 'all',
- emptyText:'Select a Language...',
- selectOnFocus:true,
- listeners : {
- select : function(cb, J, ix) {
-
-
- Pman.Login.switchLang(J.data.lang);
-
- }
- }
-
- })
-
- );
-
-
- var ef = this.dialog.getLayout().getEl().createChild({tag: 'div'});
- ef.dom.style.margin = 10;
-
- this.form.render(ef.dom);
-
- Pman.Login.form.el.createChild({
- tag: 'img',
- src: rootURL + '/Pman/'+appNameShort + '/templates/images/logo.gif',
- style: 'margin-bottom: 10px;'
- },
- Pman.Login.form.el.dom.firstChild
- );
-
- var vp = this.dialog.getLayout().add('center', new Roo.ContentPanel(ef, {
- autoCreate : true,
-
-
- width: 250,
- maxWidth: 250,
- fitToFrame:true
- }));
-
- this.layout.endUpdate();
-
- this.fireEvent('render', this);
-
-
-
-
-
- },
- resizeToLogo : function()
- {
- var sz = Roo.get(Pman.Login.form.el.query('img')[0]).getSize();
- if (!sz) {
- this.resizeToLogo.defer(1000,this);
- return;
- }
- var w = Ext.lib.Dom.getViewWidth() - 100;
- var h = Ext.lib.Dom.getViewHeight() - 100;
- Pman.Login.dialog.resizeTo(Math.max(350, Math.min(sz.width + 30, w)),Math.min(sz.height+200, h));
- Pman.Login.dialog.center();
- },
-
-
-
- show: function (J)
- {
- if (this.disabled) {
- return;
- }
-
- J = J || false;
- if (Pman.Login.authUserId < 0) {
- return;
- }
-
- if (Pman.Login.intervalID) {
-
- window.clearInterval(Pman.Login.intervalID);
- Pman.Login.intervalID = false;
- }
-
-
- this.create();
-
-
-
- if (Roo.get('loading')) {
- Roo.get('loading').remove();
- }
- if (Roo.get('loading-mask')) {
- Roo.get('loading-mask').hide();
- }
-
-
-
- this.form.reset();
- this.dialog.modal = !J;
- this.dialog.show();
- this.dialog.el.unmask();
- this.resizeToLogo.defer(1000,this);
-
-
- this.form.setValues({
- 'username' : Roo.state.Manager.get('Pman.Login.username.'+appNameShort, ''),
- 'lang' : Roo.state.Manager.get('Pman.Login.lang.'+appNameShort, 'en')
- });
- Pman.Login.switchLang(Roo.state.Manager.get('Pman.Login.lang.'+appNameShort, ''));
- if (this.form.findField('username').getValue().length > 0 ){
- this.form.findField('password').focus();
- } else {
- this.form.findField('username').focus();
- }
-
-
- },
-
-
-
- logout: function()
- {
- window.onbeforeunload = function() { };
- Pman.Login.authUserId = -1;
- Roo.Ajax.request({
- url: baseURL + '/Login.html',
- params: {
- logout: 1
- },
- method: 'GET',
- failure : function() {
- Roo.MessageBox.alert(_T["8391d964e04c0c30d9f19bf036136c8d"], _T["b9f8e134e8143020e2eb596292c7c1d1"], function() {
- document.location = baseURL + '?ts=' + Math.random();
- });
-
- },
- success : function() {
- Pman.Login.authUserId = -1;
- Pman.Login.checkFails =0;
-
- document.location = baseURL + '?ts=' + Math.random();
- }
-
-
- });
- },
- switchLang : function (K) {
- if (!K.length) {
- return;
- }
- if (typeof(_T.en) == 'undefined') {
- _T.en = {};
- Roo.apply(_T.en, _T);
- }
-
- if (typeof(_T[K]) == 'undefined') {
- Roo.MessageBox.alert(_T["20f52c7354a3fd19843e600c53121d94"], _T["1ba0950dff36aebd0c55f3b195edcb11"] + K +')');
- return;
- }
-
-
-
- Roo.apply(_T, _T[K]);
-
- if (this.form) {
-
-
- function L(M, N) {
-
- var O = Pman.Login.form.findField( M ).el.dom.parentNode.parentNode;
- if (O.getElementsByTagName('label').length) {
- O = O.getElementsByTagName('label')[0];
- } else {
- O = O.parentNode.getElementsByTagName('label')[0];
- }
-
-
- O.innerHTML = N;
- }
-
-
- L('password', _T["3b9a78188b115fa00e2285cd1047a02e"]+':');
- L('username', _T["7e698d4c146d9eefd5dcd10552b18098"]+':');
- L('lang', _T["b2a3486b5105e365dae1a1796390ba42"]+':');
- this.dialog.setTitle(_T["68156a5e398303b805bd96fbc6b1f8ee"]);
- this.dialog.buttons[0].setText(_T["b2d0ea65f8ae06179a40d78e52b7833c"]);
- this.dialog.buttons[1].setText(_T["68156a5e398303b805bd96fbc6b1f8ee"]);
- }
-
-
- },
-
- inGroup : function(g)
- {
- return this.authUser && this.authUser.groups &&
- this.authUser.groups.indexOf(g) > -1;
- },
- isOwner : function()
- {
- return this.authUser && this.authUser.company_id_comptype &&
- this.authUser.company_id_comptype == 'OWNER';
- },
-
-
-
-
- i18nList: function (M, N)
- {
-
- return Pman.I18n.listToNames(M, N);
- },
- i18n: function(O, P)
- {
- return Pman.I18n.toName(O, P);
-
- }
-
-
-});
-
-
-
-
-
-
-
-
-
-
-Pman.PasswordChange = {
-
-
-
- dialog : false,
- form : false,
- create: function()
- {
- if (this.dialog) {
- return;
- }
- var A = this;
-
-
- this.dialog = new Ext.LayoutDialog(Ext.get(document.body).createChild({tag:'div'}), {
- autoCreated: true,
- title: _T["eadd75daa6471a87eb75121dd5eab06a"],
- modal: true,
- width: 500,
- height: 160,
- shadow:true,
- resizable: false,
- closable: false,
- draggable: false,
- center: {
- autoScroll:false,
- titlebar: false,
-
- hideTabs: true,
- closeOnTab: true,
- alwaysShowTabs: false
- }
-
-
- });
- var B = function(C) {
- Pman.Preview.tmpEnable();
-
- A.dialog.hide();
- if (A.callback) {
- A.callback.call(this, C ? C : false);
- }
- };
-
- this.dialog.addKeyListener(27, B,this);
- this.dialog.addButton(_T["9b6839c225da5cb93c3bf29720e0531d"],B,this);
- this.dialog.addButton(_T["f7c61a97b669d7f5128b51c8644c400c"], this.save, this);
-
-
- this.layout = this.dialog.getLayout();
- this.layout.beginUpdate();
-
-
- this.form = new Ext.form.Form({
- labelWidth: 220 ,
-
- listeners : {
- actionfailed : function(f, C) {
-
- A.dialog.el.unmask();
-
-
- if (C.failureType == 'client') {
- Ext.MessageBox.alert(_T["db88368227b739ed12b165005f43d2c9"], _T["23b47796783d663d3113bde8469f9202"]);
- return;
-
- }
-
- if (C.type == 'submit') {
-
- Ext.MessageBox.alert(_T["db88368227b739ed12b165005f43d2c9"], typeof(C.result.errorMsg) == 'string' ?
- C.result.errorMsg :
- _T["25092a9a028d282401e526d9252c734d"]);
- return;
- }
-
-
-
- Ext.MessageBox.alert(_T["db88368227b739ed12b165005f43d2c9"], _T["39b3f1da7208ad35ea991d47bb460b30"]);
-
- },
- actioncomplete: function(f, D) {
- A.dialog.el.unmask();
-
- if (D.type == 'submit') {
- B(D.data);
- return;
- }
-
- }
- }
-
-
-
-
- });
-
- this.form.addxtype.apply(this.form,[
- {
- name : 'passwd1',
- fieldLabel : _T["1b6ed9a99ae0f49a874fab476d0e70c4"],
- value : '',
- allowBlank : false,
- inputType: 'password',
- xtype : 'SecurePass',
- width : 220,
- imageRoot : rootURL + '/Pman/templates/images'
- },
- {
-
- name : 'passwd2',
- fieldLabel : _T["6f52a45578b8376c688a75ddc7888122"],
- value : '',
- allowBlank : false,
- inputType: 'password',
- xtype : 'TextField',
- width : 220
- },
-
- {
- name : 'passwordReset',
- value : '',
- xtype : 'Hidden'
-
- }
- ]);
-
-
-
-
- var ef = this.dialog.getLayout().getEl().createChild({tag: 'div'});
- ef.dom.style.margin = 10;
-
- this.form.render(ef.dom);
-
- var vp = this.dialog.getLayout().add('center', new Ext.ContentPanel(ef, {
- autoCreate : true,
-
-
- width: 250,
- maxWidth: 250,
- fitToFrame:true
- }));
-
-
-
- this.layout.endUpdate();
- },
- _id : 0,
- show : function(C, D)
- {
- this.callback= D;
- this.data = C;
- this.create();
- this.form.reset();
-
-
- this.form.setValues(C);
-
- Pman.Preview.tmpDisable();
-
- this.dialog.show();
- this.form.findField('passwd1').focus();
-
- },
- save : function()
- {
- var p1 = this.form.findField('passwd1').getValue();
- var p2 = this.form.findField('passwd2').getValue();
- if (!p1.length || !p2.length) {
- Ext.MessageBox.alert(_T["db88368227b739ed12b165005f43d2c9"], _T["78a7430d961bec5b3d4759206ebc2b04"]);
- }
- if (p1 != p2) {
- Ext.MessageBox.alert(_T["db88368227b739ed12b165005f43d2c9"], _T["a217bd43e7427e981bc8dbf18998faed"]);
- }
-
-
- this.form.doAction('submit', {
- url: baseURL + '/Login.html',
- method: 'POST',
- params: {
- changePassword: true,
- ts : Math.random()
- }
- });
- }
-
-
-
-
-}
-
-
-
-
-
-Pman.Preview = {
-
- frame : false,
- pdf : false,
- imgDiv : false,
- active: false,
- init : function()
- {
-
- if (this.frame) {
- return;
- }
-
-
-
-
-
- if (Roo.isGecko) {
- this.pdf = Ext.DomHelper.append(
- document.body,
- {
- id : 'pdf-view',
- tag: 'object',
- type : 'application/pdf',
- data : 'about:blank',
- width : 200,
- height :200,
- style : 'position:absolute;top:-1000;left:-1000; z-index:-100',
- cn : [
- {
- tag: 'param',
- name : 'src',
- value : 'about:blank'
- }
- ]
- },
- false
- );
-
- }
-
- this.imgDiv = Ext.DomHelper.append(
- document.body,
- {
- tag:'div',
- style : 'position:absolute;top:-1000;left:-1000; z-index:-100;' +
- 'overflow-x:hidden;overflow-y:scroll;width:200px; height: 200px;'
- }
- );
-
- this.frame = Ext.DomHelper.append(
- document.body,
- {
- tag:'iframe',
- src: 'about:blank',
- style : 'position:absolute;top:-1000;left:-1000; z-index:-100;' +
- 'width:1px; height: 1px;'
- }
- );
-
- },
- config : false,
-
-
- onResize : function()
- {
- if (this.active ) {
- this.active.style.zIndex = this.activeCfg ? this.activeCfg.zIndex : -100;
- }
-
-
-
-
-
-
-
-
- if (!this.config.previewRegion) {
- return;
- }
-
-
-
- var A = this.config.previewRegion.el.getBox();
- if (A.width < 10) {
- return;
- }
-
-
-
- if (!this.active) {
- return;
- }
-
-
- this.active.setAttribute( 'width',A.width);
- this.active.setAttribute( 'height',A.height);
-
- this.active.style.width = A.width + 'px';
- this.active.style.height = A.height + 'px';
-
-
- this.active.style.top = A.y + 'px';
- this.active.style.left = A.x + 'px';
-
-
-
- },
-
-
-
- unlink: function ()
- {
-
- if (!this.config) {
- return;
- }
- if (this.config.dialog ) {
- this.config.dialog.un('hide', this.onHide, this);
- }
- if (this.config.tab) {
- this.config.tab.un('deactivate', this.onHide, this);
- }
-
- this.config.previewRegion.un('resized', this.onResize, this);
-
- this.config = false;
- },
-
- link: function(B)
- {
-
-
- this.init();
- if (this.config) {
- this.unlink();
- }
-
- this.config = B;
- if (this.config.dialog) {
- this.config.dialog.on('hide', this.onHide, this);
- }
- if (this.config.tab) {
- this.config.tab.on('deactivate', this.onHide, this);
- }
-
-
- this.config.previewRegion.on('resized', this.onResize, this);
-
- },
-
-
- removeActive: function()
- {
- if (!this.active) {
- return;
- }
-
- this.active.style.left='-1000px';
- this.active.style.top='-1000px';
- this.active.style.width='200px';
- this.active.style.top='200px';
- this.active.style.zIndex= -100;
- this.active = false;
- },
-
- onHide: function () {
- if (!this.active) {
- return;
- }
-
- this.removeActive();
- this.unlink();
- },
-
- showPdf : function()
- {
- this.removeActive();
- this.activeCfg.url = this.activeCfg.pdfurl;
- this.activeCfg.mimetype = 'application/pdf';
- this.load(this.activeCfg);
- },
-
-
-
- load : function(C)
- {
-
- this.activeCfg = false;
- if (typeof(C) != 'object') {
- alert('Preview Load only accepts object with url/mimetype/zIndex as loader');
- return;
- }
-
- this.activeCfg = Roo.apply({},C);
- var D = this.activeCfg.url;
- var E = this.activeCfg.mimetype;
-
- this.removeActive();
-
-
- switch (E) {
-
- case 'image/jpeg':
-
-
- var ps = this.config.previewRegion.el.getBox();
-
- this.imgDiv.innerHTML = '<img src="' + D +'"' +
- ' width="'+ (ps.width-15) + '"' +
- ' qtip="'+ _T["e4fe205ae80b87b90434e12e5e3a4c9b"] + '"' +
- ' ext:width="100"' +
- ' onclick="Pman.Preview.showPdf();"/>';
- this.active = this.imgDiv;
- this.enable(this.activeCfg.zIndex);
- return;
- break;
-
-
- case 'application/pdf':
- case 'application/msword':
- case 'application/vnd.oasis.opendocument.text':
-
- case 'application/vnd.ms-excel':
- case 'application/vnd.oasis.opendocument.spreadsheet':
- case 'application/vnd.dwg':
- case 'application/acad':
- case 'application/x-acad':
- case 'application/autocad_dwg':
- case 'image/x-dwg':
- case 'application/dwg':
- case 'application/x-dwg':
- case 'application/x-autocad':
- case 'image/vnd.dwg':
- case 'drawing/dwg':
-
- if (!D.match(/\.pdf$/)) {
- D += '.pdf';
- }
-
- if (!Roo.isGecko) {
-
- this.frame.src = D;
- this.active = this.frame;
- this.enable(this.activeCfg.zIndex);
- return;
- }
-
- this.pdf.setAttribute( 'data', D);
-
- this.active = this.pdf;
- this.enable(this.activeCfg.zIndex);
- return;
-
- default:
- this.frame.src = D;
- this.active = this.frame;
- this.enable(this.activeCfg.zIndex);
- return;
-
-
- }
-
-
- },
- disable: function()
- {
-
- if (!this.active) {
- return;
- }
-
- this.disabled = true;
- this.active.style.zIndex = -100;
- if (!Roo.isGecko) {
- this.frame.src= 'about:blank';
- }
- },
- enable: function(F)
- {
- if (!this.active) {
- return;
- }
-
- this.disabled = false;
-
- this.active.style.zIndex = F ? F : 10000;
- if (!Roo.isGecko && this.activeCfg) {
- this.frame.src= this.activeCfg.url;
- }
-
-
- this.onResize();
- },
- tmpStatus : false,
- tmpDisable : function()
- {
- if (this.disabled) {
- this.tmpStatus = false;
- return;
- }
-
- this.tmpStatus = true;
- this.disable();
- },
- tmpEnable: function()
- {
- if (!this.tmpStatus) {
- return;
- }
-
- this.tmpStatus = false;
- this.enable();
- }
-
-
-}
-
-
-
-
-
-Pman.Std = {
- project_id : function (A) {
- A = A || {};
- A.storeListeners = A.storeListeners || {};
- return Roo.apply({
-
- width: 200,
- fieldLabel: _T["e82288f1b4eba83e3912993b59e9874c"],
- name : 'project_id_code',
- hiddenName: 'project_id',
-
- allowBlank : false,
- selectOnFocus:true,
- qtip : _T["8e24b2c00ecb83fdbedee6634dbe7a6e"],
-
-
-
- xtype: 'ComboBox',
-
- store: {
- xtype : 'Store',
-
- proxy: {
- xtype : 'HttpProxy',
- url: baseURL + '/Roo/Projects.html',
- method: 'GET'
- },
- reader: Pman.Readers.Projects,
- listeners : Roo.apply(
- {
- loadexception : Pman.loadException
- },
- A.storeListeners
- ),
- remoteSort : true,
- sortInfo: {
- field: 'code', direction: 'ASC'
- }
- },
- displayField:'code',
- valueField : 'id',
-
- typeAhead: true,
- forceSelection: true,
-
- triggerAction: 'all',
- tpl: new Ext.Template(
- '<div class="x-grid-cell-text x-btn button">',
- '<b>{code}</b> {name}',
- '</div>'
- ),
- queryParam: 'query[project_search]',
- loadingText: _T["dacaeb74293d8e9bb58c28681b02c321"],
- listWidth: 400,
-
- minChars: 2,
- pageSize:20
-
- }, A);
- },
-
-
- company_id : function(B) {
- B = B || {};
- B.storeListeners = B.storeListeners || {};
-
- B.listeners = B.listeners || {};
-
- return Roo.apply({
-
-
- name : 'addressto_name',
- displayField:'name',
-
- fieldLabel : _T["993475eb7faf2229459aa6ca1c3745e9"],
- allowBlank : true,
- qtip : _T["f7e6a2016c5b5f0113b18708d84db782"],
- width: 290,
-
-
- value : '',
- xtype: 'ComboBoxAdder',
- selectOnFocus:true,
- allowBlank : false,
-
-
- store: {
-
- xtype: 'Store',
- proxy: {
- xtype : 'HttpProxy',
- url: baseURL + '/Roo/Companies.html',
- method: 'GET'
- },
- reader: Pman.Readers.Companies,
-
- listeners : Roo.apply(
- {
- loadexception : Pman.loadException
- },
- B.storeListeners
- ),
- remoteSort : true,
- sortInfo: {
- field: 'name', direction: 'ASC'
- }
-
- },
-
- typeAhead: true,
- forceSelection: true,
-
- triggerAction: 'all',
- tpl: new Ext.Template(
- '<div class="x-grid-cell-text x-btn button">',
- '<b>{name}</b> {address}',
- '</div>'
- ),
- queryParam: 'query[name]',
- loadingText: _T["dacaeb74293d8e9bb58c28681b02c321"],
- listWidth: 400,
-
- minChars: 2,
- pageSize:20
-
- }, B);
- },
-
- doctype_name: function(C) {
- C = C || {};
- return Roo.apply({
-
- name : 'doctype_name',
- width : 290,
- fieldLabel : _T["adaa177b337c92793900a09979b7644f"],
- allowBlank : false,
-
-
- qtip : _T["f3ae3d381d60864b13244e2ac16c12fe"],
-
- value : '',
-
- xtype : 'ComboBox',
- store: {
-
- xtype: 'Store',
- proxy: {
- xtype: 'HttpProxy',
- url: baseURL + '/Roo/Document_Types.html',
- method: 'GET'
- },
-
- reader: Pman.Readers.Document_Types,
- listeners : {
- beforeload: function(t, o) {
-
- o.params.limit = 9999;
- },
- loadexception : Pman.loadException
-
- },
- remoteSort: true,
- sortInfo: {
- field: 'name', direction: 'ASC'
- }
- },
- displayField:'name',
-
- typeAhead: false,
- editable: false,
-
- triggerAction: 'all',
-
- selectOnFocus:true
- }, C);
- },
-
-
- address_list_adder : function(D) {
- D = D || {};
- D.storeListeners = D.storeListeners || {};
- return Roo.apply({
-
- name : 'send_to',
- fieldLabel : _T["f6551e5409cd0bd1293c73466c0d5a71"],
- idField : 'email',
-
- renderer : function(d) {
- return String.format('{0}',
- d.name.length ? d.name : d.email
- );
- },
-
-
- xtype: 'ComboBoxLister',
- displayField:'name',
- value : '',
-
- qtip : _T["397925800f038e68f28adacc0c39d6ca"],
- selectOnFocus:true,
- allowBlank : true,
- width: 150,
-
-
- store: {
- xtype : 'Store',
-
- proxy: {
- xtype : 'HttpProxy',
- url: baseURL + '/Roo/Person.html',
- method: 'GET'
- },
- reader: Pman.Readers.Companies,
- listeners : D.storeListeners,
- remoteSort : true,
- sortInfo: {
- field: 'name', direction: 'ASC'
- }
- },
-
-
- typeAhead: true,
- forceSelection: true,
-
- triggerAction: 'all',
- tpl: new Ext.Template(
- '<div class="x-grid-cell-text x-btn button">',
- '<b>{name}</b> {email}',
- '</div>'
- ),
- queryParam: 'query[name]',
- loadingText: _T["dacaeb74293d8e9bb58c28681b02c321"],
- listWidth: 400,
-
- minChars: 2,
- pageSize:20,
- setList : function(ar) {
- var E = this;
- Roo.each(ar, function(a) {
- E.addItem(a);
- });
- },
- toList : function() {
- var F = [];
- this.items.each(function(a) {
- F.push(a.data);
- });
- return F;
- }
-
-
- }, D);
- },
-
-
- our_office_id : function(E)
- {
- E = E || {};
- E.listeners = E.listeners || {};
- return Roo.apply({
- xtype: 'ComboBoxAdder',
- fieldLabel: _T["964610e35dbc2d5e2ef34f1492eff1c7"],
-
- hiddenName: 'office_id',
- name : 'office_id_name',
-
- qtip : _T["2b617d7e2e8fdfe8fee08f5086f6e7b7"],
- width: 300,
- allowBlank : true,
- triggerAction: 'all',
-
-
- typeAhead: true,
- forceSelection: true,
- selectOnFocus:true,
-
- displayField:'name',
- valueField : 'id',
-
- store: {
- xtype : 'Store',
-
- proxy: {
- xtype : 'HttpProxy',
- url: baseURL + '/Roo/Office.html',
- method: 'GET'
- },
- reader: Pman.Readers.Office,
- listeners : Roo.apply({
- loadexception : Pman.loadException
- }, E.storeListeners
- ),
- remoteSort : true,
- sortInfo: {
- field: 'name', direction: 'ASC'
- }
- },
- listeners : Roo.apply({
- adderclick : function()
- {
-
- var F = {
- company_id : Pman.Login.authUser.company_id * 1,
- company_id_name: Pman.Login.authUser.company_id_name,
- address: '',
- phone: '',
- fax: '',
- email: ''
- };
-
-
- Pman.Preview.tmpDisable();
-
- Pman.Dialog.Office.show(F, function(G) {
- _this.setFromData(G);
- Pman.Preview.tmpEnable();
- });
- }
- }, E.listeners),
-
-
-
- tpl: new Ext.Template(
- '<div class="x-grid-cell-text x-btn button">',
- '<b>{name}</b> {address}',
- '</div>'
- ),
- queryParam: 'query[name]',
- loadingText: _T["dacaeb74293d8e9bb58c28681b02c321"],
- listWidth: 400,
-
- minChars: 2,
- pageSize:20
-
-
-
- }, E);
- },
-
-
-
-
- country: function(F) { return Pman.I18n.country(F); },
- language: function(G) { return Pman.I18n.language(G); },
-
- languageList : function(H) { return Pman.I18n.languageList(H); },
- countryList : function(I) { return Pman.I18n.countryList(I); }
-
-
-};
-
-
-
-
-
-
-Pman.Tab.GroupsList = function(A) {
- Ext.apply(this, A);
-};
-
-Pman.Tab.GroupsList.prototype = {
- id : false,
- grid : false,
- panel : false,
- getDialog : false,
- title : false,
- type : 0,
- disabled : false,
- add : function(B, C) {
-
- var D = this;
-
- var E = function() {
- D.refresh();
- };
-
- if (this.panel) {
- B.getRegion(C).showPanel(this.panel);
- return;
- }
-
- var F = function()
- {
- var K = B.getRegion('center').getActivePanel();
- if (K && K.controller) {
- K.controller.refresh();
- return;
- }
-
- var L = K.id;
- if (!L) {
- return;
- }
-
- Pman.Tab[L].refresh();
- };
-
- var G = B.getRegion(C).getEl().createChild({tag:'div'});
-
- this.grid = new Ext.grid.Grid(G, {
- id: D.id + '-groups',
-
-
- enableDrop:true,
- ddGroup: 'groupDD',
-
-
-
-
-
- ds: new Ext.data.Store({
-
-
-
- proxy: new Ext.data.HttpProxy({
- url: baseURL + '/Roo/Groups.html',
- method: 'GET'
- }),
- remoteSort: true,
- reader: Pman.Readers.Groups,
- sortInfo: {
- field: 'name', direction: 'ASC'
- },
- listeners : {
-
- beforeload: function(t, o) {
-
- if (!o.params) {
- o.params = {};
- }
-
- o.params.type = D.type;
-
-
- },
- load : function()
- {
- var sm = D.grid.getSelectionModel();
- if (!sm.getSelections().length) {
- sm.selectFirstRow();
- }
-
- F();
-
-
- },
- loadexception : Pman.loadException
-
- }
- }),
- sm: new Ext.grid.RowSelectionModel({ singleSelect: true }),
- cm: new Ext.grid.ColumnModel(
- [{
- id : D.id + '-name',
- header : _T["45e376f384cdb1f67a866700b892b3e8"],
- dataIndex : 'name',
- sortable : true,
- width : 100,
- renderer : function(v,x,r) {
- if (r.data.id == -1) {
- return '<b>' + _T["d5cd30d9a8889de9ad91d34e09da494b"] + '</b>';
- }
- if ((r.data.id == 0) && (D.type == 0)) {
- return '<b>' + _T["8b2b7b9a1be82d2550e1d2bf71504f40"] + '</b>';
- }
- if ((r.data.id == 0) && (D.type == 2)) {
- return '<b>' + _T["0534e1944a96427d47b562c494d85447"] + '</b>';
- }
- if (r.data.id == 0) {
- return '<b>' + _T["0b0e4ee0b6875cbaa307a8d7f3c3d7ee"] + '</b>';
- }
- if (v == 'Administrators') {
- return '<b>' + _T["b9b270f938cabca10640a932c830a4ce"] + '</b>';
- }
- if (r.data.leader) {
- return v + ' (' + r.data.leader_name + ')';
- }
-
- return v;
-
-
-
- }
- }]
- ),
- autoExpandColumn: D.id + '-name' ,
- clicksToEdit : 1,
-
- loadMask: true,
- listeners : {
- rowclick: function(g, ri, e)
- {
- F();
- }
- }
-
- });
-
-
- this.panel = B.add(C, new Ext.GridPanel(this.grid ,
- { fitToframe: true,fitContainer: true, title: D.title, id : D.id, background: true})
- );
- this.grid.render();
-
-
- new Ext.dd.DropTarget(D.grid.getView().mainBody, {
- ddGroup : 'groupDD',
- copy : true,
-
- notifyOver : function(dd, e, K){
- var t = Roo.lib.Event.getTarget(e);
- var ri = D.grid.view.findRowIndex(t);
- var L = false;
- if (ri !== false) {
- L = D.grid.getDataSource().getAt(ri).data;
- }
-
- var s = D.grid.getSelectionModel().getSelections();
-
- var M = s.length ? s[0].data.id > 0 : false;
-
- var N = L && L.id > 0;
-
- if (M && N) {
- return this.dropNotAllowed;
- }
- if (!M && !N) {
- return this.dropNotAllowed;
- }
- if (M && !N) {
- return 'x-dd-drop-ok-sub';
- }
-
- return 'x-dd-drop-ok-add';
-
-
-
- },
- notifyDrop : function(dd, e, O){
-
- var t = Roo.lib.Event.getTarget(e);
- var ri = D.grid.view.findRowIndex(t);
- var P = false;
- if (ri !== false) {
- P = D.grid.getDataSource().getAt(ri).data;
- }
- var s = D.grid.getSelectionModel().getSelections();
-
-
- var Q = s.length ? s[0].data.id > 0 : false;
-
- var R = P && P.id > 0;
-
- if (Q && R) {
- return false;
- }
- if (!Q && !R) {
- return false;
- }
- var S = 'add';
- if (Q && !R) {
- S = 'sub';
-
- }
-
- var T = [];
- for (var i=0; i < O.selections.length; i++) {
- T.push(O.selections[i].data.id);
- }
-
-
- Pman.request({
- url: baseURL + '/Core/GroupMembers.php',
- params: {
- action : S,
- group_id: S =='add' ? P.id : s[0].data.id,
- type: D.type,
- user_ids : T.join(',')
-
- },
- method: 'POST',
- success : function(U) {
- E();
- },
-
- failure: function() {
-
-
-
-
-
- }
- });
-
-
-
-
-
- return true;
-
-
-
- }
- });
-
-
-
- var H = this.grid;
-
- var I = this.grid.getView().getHeaderPanel(true);
- this.toolbar = new Ext.Toolbar(I);
-
-
- var J= this.getDialog();
- this.toolbar.add({
-
- text: _T["982d7a1e24433e552a3d694a095f053e"],
- cls: 'x-btn-text-icon',
- icon: Ext.rootURL + 'images/default/tree/leaf.gif',
- menu : {
- items : [
-
- {
- text: _T["0f65f59038860dbf03201afab99fe7e1"],
- cls: 'x-btn-text-icon',
- icon: Ext.rootURL + 'images/default/dd/drop-add.gif',
- hidden : !Pman.hasPerm('Core.Groups', 'A'),
- handler : function(){
- J.show( { id : 0, type: D.type }, E );
- }
- },
- {
- text: _T["0537a153a0e54447d83d2c8d094a03d1"],
- cls: 'x-btn-text-icon',
- icon: Ext.rootURL + 'images/default/tree/leaf.gif',
- hidden : !Pman.hasPerm('Core.Groups', 'E'),
- handler : function() {
- var s = H.getSelectionModel().getSelections();
- if (!s.length || (s.length > 1)) {
- Ext.MessageBox.alert(_T["081fcfe0460716e500eeab497d45d6b8"], s.length ? _T["f845801a4be23199251c41e1c2ac5e98"] : _T["178044591ed0652d2b82b7f7eb90b22a"]);
- return;
- }
- if ((s[0].data.name == 'Administrators') ||(s[0].data.name == 'Default')) {
- Ext.MessageBox.alert(_T["081fcfe0460716e500eeab497d45d6b8"], _T["075c26b58d3827f7726bb1eb7c2d13dc"]);
- return;
- }
- if (s.data.id < 1) {
- Ext.MessageBox.alert(_T["081fcfe0460716e500eeab497d45d6b8"], _T["075c26b58d3827f7726bb1eb7c2d13dc"]);
- return;
- }
-
- J.show(s[0].data, E);
- }
- },
-
- {
- text: _T["1eeb327bd294d207da46d9cfb93f9042"],
- cls: 'x-btn-text-icon',
- icon: rootURL + '/Pman/templates/images/trash.gif',
- hidden : !Pman.hasPerm('Core.Groups', 'D'),
- handler : function(){
- var s = H.getSelectionModel().getSelections();
-
- for(var i = 0; i < s.length; i++) {
-
- if ((s[i].data.id < 1) || (s[i].data.name == 'Administrators')) {
- Ext.MessageBox.alert(_T["081fcfe0460716e500eeab497d45d6b8"], _T["2d481b48a578e9122e0cda91604a73b1"]);
- return;
- }
- }
-
-
-
- Pman.genericDelete(D, 'Groups');
- }
- } , '-',
- {
- text: _T["726e57af6b8966adfdcaa385105de4d1"],
- cls: 'x-btn-text-icon',
- icon: rootURL + '/Pman/templates/images/view-refresh.gif',
- handler : function(){
- E();
- }
- }
- ]
- }
-
- });
- this.panel.on('activate', function() {
-
- });
-
-
-
-
-
-
-
- },
- refresh: function()
- {
- this.grid.getDataSource().reload();
- }
-
-};
-
-
-
-
-
-
-
-
-Pman.Tab.PersonList = function(A)
-{
- Ext.apply(this, A);
-}
-
-
-Pman.Tab.PersonList.prototype = {
-
-
- id : '',
- type : 0,
- title : false,
- hiddenColumns: false,
- itemDisplayName : false,
- permName : 'Core.Person',
- getLeftSelections : function() { return []; },
- hideDelete : false,
-
-
- beforeload: function(t, o) {
-
-
- alert('person list not configured');
- return false;
- var B = _this.getLeftSelections();
-
- if (B.length) {
- o.params['query[in_group]'] = B[0].data.id;
- }
-
- o.params['query[name]'] = this.searchBox.getValue();
- o.params['query[type]'] = this.type;
- o.params['query[person_internal_only_all]'] = 1;
- o.params['query[person_inactive]'] = this.showInActive ? 0 : 1;
-
- },
-
- columns : function()
- {
- alert('person list not configured');
- return false;
- return [
- this.c_name(),
- this.c_office_id_name(),
- this.c_role(),
- this.c_phone(),
- this.c_fax(),
- this.c_email(),
- this.c_active()
- ]
- },
-
- dialog: function () {
- alert('person list not configured');
- return false;
- return Pman.Dialog.PersonStaff;
- },
- bulkAdd : function() {
-
- return false;
- },
- newDefaults : function() {
- alert('person list not configured');
- return false;
- return {
-
- id : 0,
- company_id : Pman.Login.authUser.company_id,
- company_id_name : Pman.Login.authUser.company_id_name,
- company_id_address : Pman.Login.authUser.company_id_address,
- company_id_tel : Pman.Login.authUser.company_id_tel,
- company_id_fax : Pman.Login.authUser.company_id_fax
- };
- },
-
-
-
-
-
-
- parentLayout : false,
- showInActive : 0,
- grid : false,
- panel : false,
- toolbar : false,
- paging: false,
- tab: false,
-
-
- refreshWestPanel : function()
- {
- var C = this.parentLayout.getRegion('west').getActivePanel();
- if (C && C.controller) {
- C.controller.paging.onClick('refresh');
- return;
- }
-
-
- if (!C || !C.id) {
- return;
- }
-
- Pman.Tab[C.id].refresh();
- },
-
- refresh: function(){
- if (!this.paging) {
- this.delayedCreate();
- }
-
- this.paging.onClick('refresh');
- },
-
- loadFirst: function(){
- if (!this.paging) {
- this.delayedCreate();
- }
-
- this.paging.onClick('first');
- },
-
-
-
- add : function(D, E) {
-
- var F = this;
- if (this.tab) {
- D.getRegion(E).showPanel(this.panel);
- return;
- }
-
- this.parentLayout = D;
-
- this.layout = new Ext.BorderLayout(
- D.getEl().createChild({tag:'div'}),
- {
-
- center: {
- autoScroll:true,
- hideTabs: true
- }
- }
- );
-
-
-
- this.tab = D.add(E, new Ext.NestedLayoutPanel(
- this.layout, {title: this.title, background: true, controller : this}));
-
- this.tab.on('activate', function() {
- F.delayedCreate();
-
- });
- },
- delayedCreate : function ()
-
- {
- var G = this;
- if (this.grid) {
- return;
- }
-
- var H = function() {
- G.refresh();
- }
-
- this.layout.beginUpdate();
-
- var I = this.layout.getRegion('center').getEl().createChild({tag:'div'});
-
- this.grid = new Ext.grid.Grid(I, {
- ddGroup: 'groupDD',
-
- enableDrag: true,
- id: this.id + '-grid',
- ds: new Ext.data.Store({
-
- proxy: new Ext.data.HttpProxy({
- url: baseURL + '/Roo/Person.html',
- method: 'GET'
- }),
- reader: Pman.Readers.Person,
- remoteSort: true,
- listeners : {
-
- beforeload: function(t, o) {
-
-
- return G.beforeload(t,o);
-
-
- },
- loadexception : Pman.loadException
-
- },
- sortInfo: {
- field: 'name', direction: 'ASC'
- }
- }),
- cm: new Ext.grid.ColumnModel(
- this.columns()
- ),
- autoExpandColumn: G.id + '-name' ,
- clicksToEdit : 1,
-
- loadMask: true,
-
- listeners : {
- rowdblclick : function(g, ri, e) {
- var s = g.getDataSource().getAt(ri).data;
- if (G.dialog() && Pman.hasPerm(G.permName, 'E')) {
- G.dialog().show(s,H);
- }
-
-
- }
-
- }
-
-
- });
- this.panel = this.layout.add('center', new Ext.GridPanel(this.grid , {
- fitToframe: true,
- fitContainer: true,
- id: this.id,
- title: this.title || _T["25310235b726d71d9d0bc2fc903b9a3b"],
- controller : this
- })
- );
- this.grid.render();
-
- if (this.hiddenColumns) {
- var cm = this.grid.getColumnModel();
- Roo.each(this.hiddenColumns, function(c) {
- cm.setHidden(cm.getIndexByDataIndex(c), true);
- });
- }
-
-
-
- var J = this.grid.getView().getFooterPanel(true);
- this.paging = new Ext.PagingToolbar(J, this.grid.getDataSource(), {
- pageSize: 25,
- displayInfo: true,
- displayMsg: _T["4788be05034a6a24e08add98ed12fddf"] + (this.itemDisplayName || _T["25310235b726d71d9d0bc2fc903b9a3b"]) + _T["0a1ea6b8f312884c024a49ea271b6330"],
- emptyMsg: _T["f405b2cca36f62eb81fa563a0b7406ac"] + (this.itemDisplayName || _T["25310235b726d71d9d0bc2fc903b9a3b"]) + _T["7bca1e8820519d2993ebabfa434007c9"]
- });
- var K = this.grid;
-
-
- this.toolbar = new Ext.Toolbar(this.grid.getView().getHeaderPanel(true));
-
- var tb = this.toolbar;
-
-
- if (this.parentLayout.getRegion('west') && this.parentLayout.getRegion('west').panels.length) {
-
- this.paging.add(
- '<b><i><font color="red">'+
- (this.type ?
- _T["469845eeeb8c7f2983a5fc6550af4dc7"] :
- _T["d559132c96908612dd66163dbd532812"]
- ) +
- '</font></i></b>'
- );
- }
-
- var G = this;
- if (this.permName == 'Core.Staff') {
-
- this.paging.add( '-',
- {
- text: _T["40c16e64d6bf564aa75d2287d06c9a7b"],
- pressed: false,
- enableToggle: true,
- toggleHandler: function(L,M) {
- G.showInActive = (M ? 1 : 0);
- L.setText(M ? _T["2bcbf24c822c1428b849349709d432b4"]: _T["40c16e64d6bf564aa75d2287d06c9a7b"] );
- H();
- }
- },
-
-
- '-'
- );
- }
-
-
-
- this.searchBox = new Ext.form.TextField({
- name: 'search',
- width:135,
- listeners : {
- specialkey : function(f,e)
- {
-
- if (e.getKey() == 13) {
-
- H();
- }
-
-
- }
- }
-
- });
- var dg = G.dialog();
- tb.add(
- {
- text: _T["39c8bb31d465dfc147324be427ace5e9"],
- cls: 'x-btn-text-icon',
- icon: Ext.rootURL + 'images/default/dd/drop-add.gif',
- hidden : !dg || (G.newDefaults() === false) || !Pman.hasPerm(this.permName, 'A'),
- handler : function(){
- dg.show( G.newDefaults(), H );
- }
- },
- {
- text: _T["a89b59994ae0fe49d108d3e22d68a8f3"],
- cls: 'x-btn-text-icon',
- icon: Ext.rootURL + 'images/default/dd/drop-add.gif',
- hidden : !this.bulkAdd() || !Pman.hasPerm(this.permName, 'A'),
- handler : function(){
-
-
- G.bulkAdd().show( { id : 0 }, H );
- }
- },
-
- {
- text: _T["d1ff8ffcb0bc971614aef7c0b5a07290"],
- cls: 'x-btn-text-icon',
- icon: Ext.rootURL + 'images/default/tree/leaf.gif',
- hidden : !dg || !Pman.hasPerm(this.permName, 'E'),
- handler : function(){
- var s = K.getSelectionModel().getSelections();
- if (!s.length || (s.length > 1)) {
- Ext.MessageBox.alert(_T["bf5c8b4410513986dffc6d6d6f025c5f"], s.length ? _T["8d7a86f0b9a3f7f52e7b49206b42f1ff"] : _T["f8eeb7a5fd0bed49c85e3664518a5e7c"]);
- return;
- }
-
- dg.show( s[0].data,H);
- }
- },
- {
- text: _T["022426919cf2c4cb91db4d37dbe5d24c"],
- cls: 'x-btn-text-icon',
- icon: rootURL + '/Pman/templates/images/trash.gif',
- hidden : (this.permName != 'Core.Staff') || !Pman.hasPerm(this.permName, 'E'),
- handler : function(){
-
- var s = K.getSelectionModel().getSelections();
- if (!s.length ) {
- Ext.MessageBox.alert(_T["bf5c8b4410513986dffc6d6d6f025c5f"], _T["ecb1973f7aa6a900a49efa65dfc18da4"]);
- return;
- }
- var r = [];
- for(var i = 0; i < s.length; i++) {
- r.push(s[i].data.id);
- }
-
-
-
-
- K.getView().mainWrap.mask(_T["0c87cd7a6911dfa20a87e9073a4891f0"]);
-
-
- Ext.Ajax.request({
- url: baseURL + '/Roo/Person.html',
- method: 'GET',
- params: {
- _toggleActive : r.join(',')
- },
- success: function(L) {
- var M = Pman.processResponse(L);
- K.getView().mainWrap.unmask();
- if (!M.success) {
- Ext.MessageBox.alert(_T["bf5c8b4410513986dffc6d6d6f025c5f"], M.errorMsg ? M.errorMsg : _T["864c4e5c64245516e1fcdabaf49b8de1"]);
- return;
- }
-
- H();
-
- },
- failure: function(N) {
- K.getView().mainWrap.unmask();
- Ext.MessageBox.alert(_T["bf5c8b4410513986dffc6d6d6f025c5f"], _T["864c4e5c64245516e1fcdabaf49b8de1"]);
- }
-
- });
- }
-
- },
- {
- text: _T["1984cf10277dee6c3ff92d27c3b05493"],
- cls: 'x-btn-text-icon',
- hidden : (this.permName == 'Core.Staff') || !Pman.hasPerm('Core.Person', 'D') || this.hideDelete,
- icon: rootURL + '/Pman/templates/images/trash.gif',
- handler : function(){
- Pman.genericDelete(G, 'Person');
- }
- } ,
-
-
- '-',
- 'Search: ',
-
- this.searchBox,
-
- {
-
-
- icon: rootURL + '/Pman/templates/images/search.gif',
- cls: 'x-btn-icon',
- qtip: _T["f128b31c31b3754f5792d2eefdca21d0"],
- handler : function () {
- G.grid.getSelectionModel().clearSelections();
-
- H();
- }
- },
- {
-
-
- icon: rootURL + '/Pman/templates/images/edit-clear.gif',
- cls: 'x-btn-icon',
- qtip: _T["87472631093f63c722db73519eb9e4b9"],
- handler : function () {
- G.searchBox.setValue('');
- G.grid.getSelectionModel().clearSelections();
-
- H();
- }
- }
-
-
- );
-
-
-
-
-
- this.layout.endUpdate();
-
-
-
- },
-
-
-
- c_project_id_code : function(L) {
- L = L || {};
- return Roo.apply({
- header : _T["4d49b66bbfd392f5307e93c277054732"],
- dataIndex : 'project_id_code',
- sortable : false,
- width : 70,
- renderer : function(v,x,r) {
- return String.format('<span qtip="{0}">{1}</span>',
- r.data.action_type,
- v);
- }
- },L);
- },
-
-
-
-
- c_name : function(M) {
- M = M || {};
- return Roo.apply({
- id : this.id + '-name',
- header : _T["aacd489f97738135f87d1c85be64536b"],
- dataIndex : 'name',
- sortable : true,
- width : 150
- }, M);
- },
- c_company_id_comptype : function(N) {
- N = N || {};
- return Roo.apply({
- header : _T["bd87244321a326daa26695ab4b721c7c"],
- dataIndex : 'company_id_comptype',
- sortable : true,
- width : 70
- }, N);
- },
-
- c_company_id_name : function(O) {
- O = O || {};
- return Roo.apply({
- header : _T["60c647263578176b102261a5ae1004a6"],
- dataIndex : 'company_id_name',
- sortable : true,
- width : 150,
- renderer: function(v,x,r) {
- return String.format('{0}{1}{2}',
- v,
- r.data.office_id ? ' / ' : '',
- r.data.office_id_name);
- }
-
- }, O);
- },
-
- c_office_id_name : function(P) {
- P = P || {};
- return Roo.apply({
- header : _T["3bb13cf053c9459ba5f2bad62a2e208b"],
- dataIndex : 'office_id_name',
- sortable : true,
- width : 150
- }, P);
-
- },
- c_role : function(Q) {
- Q = Q || {};
- return Roo.apply({
- header : _T["118585dae50b38d2079b28afa5d768d6"],
- dataIndex : 'role',
- sortable : true,
- width : 100
- }, Q);
-
- },
- c_phone : function(R) {
- R = R || {};
- return Roo.apply({
- header : _T["0bfc17408bdeecfce4652e09c3b90621"],
- dataIndex : 'phone',
- sortable : true,
- width : 70
- }, R);
-
- },
- c_fax : function(S) {
- S = S || {};
- return Roo.apply({
- header : _T["1ee4e8e2d1859ff63a7b58f29505249f"],
- dataIndex : 'fax',
- sortable : true,
- width : 70
- }, S);
-
- },
- c_email : function(T) {
- T = T || {};
- return Roo.apply({
- header : _T["42fcc3face9df26268d1c2bf30dcd747"],
- dataIndex : 'email',
- sortable : true,
- width : 150,
- renderer : function (v) {
- return (v.length && v.indexOf('@') > 0 ) ?
- String.format('<a href="mailto:{0}">{0}</a>',v) : v;
- }
- }, T);
-
- },
- c_active : function(U) {
- U = U || {};
- return Roo.apply({
- header : _T["54bf9f5699148960b91086f351cf159e"],
- dataIndex : 'active',
- sortable : true,
- width : 50,
- renderer : function(v) {
-
-
- var V = v> 0 ? '-checked' : '';
-
- return '<img class="x-grid-check-icon' + V + '" src="' + Ext.BLANK_IMAGE_URL + '"/>';
-
-
- }
-
- }, U);
-
- }
-
-
-
-};
-
-
-
-
-
-