ååã®èšäºã§å§ãŸã£ããèšèšçµç¹ã§ã®å
¬åŒéä¿¡ã®ç®¡çããã»ã¹ã®æ¹åã«ãããç§ã®çµéšã®èª¬æãç¶ããããšæã
ãŸã ã elmaã®ä»£ããã«easla.comã·ã¹ãã ãéžæãããçä¿¡ããã¥ã¡ã³ãã®åäœãæ¢ã«èšè¿°ãããŠããããšãæãåºãããŠãã ããã

ç®æšã®æ¬¡ã®ã¹ãããã¯ãçºä¿¡ããã¥ã¡ã³ãã®åäœã説æããããšã§ãã ãããã¯è±ã§ãã...ã«ããã®äžã§ããã«å€ãã®ããã¹ããšã³ãŒãã
çºä¿¡ããã¥ã¡ã³ãã®èŠä»¶ã¯ãçä¿¡ããã¥ã¡ã³ãã®èŠä»¶ãããæ°åæ·±å»ã§ããã äž»èŠãªãã®ã®ã¿ãå¥ã®èŠçŽãªã¹ãã«åéãããšã次ã®ããã«ãªããŸãã
- çµç¹ã®åŸæ¥å¡ã«ããçºä¿¡ææžã®ç»é²
- ã«ããŒã¬ã¿ãŒã®å
±åéçºïŒãã¡ãããåæã«ã§ã¯ãªãã1ã€ã®ãã¡ã€ã«ã§ïŒ
- äžéã«ããŒã¬ã¿ãŒããŒãžã§ã³ã®ä¿å
- ããŸããŸãªåœ¢åŒã®å€æ°ã®ã¢ããªã±ãŒã·ã§ã³ã®ã¹ãã¬ãŒãž
- ãããžã§ã¯ãææžãå«ãã¢ãŒã«ã€ãïŒ zip ïŒãã¡ã€ã«ã®ä¿åïŒ TDMSããã®ããŠã³ããŒãããã³ãªããžã§ã¯ããšã®éä¿¡ã«é¢ããè¿œå æ
å ±ã®ä¿åïŒ
- ããŸããŸãªæ¹æ³ã§éä¿¡ããã¥ã¡ã³ããéä¿¡ããïŒãã®ãŸãŸã®é»åã¡ãŒã«ã1ã€ã®ã¢ãŒã«ã€ãããã«ãããªã¥ãŒã ã¢ãŒã«ã€ããå
±æã ftpãžã®ã¢ããããŒããªã©ïŒ
ã芧ã®ãšãããèŠä»¶ã¯åçŽã§ã¯ãããŸããã ããããç§ãæ°ããã·ã¹ãã ã®éžæã«éåžžã«æ³šæã
æã ã
easla.comã«èœã¡çãã
çç±ã§ãã ããããé çªã«è©±ããŸãããã
ç§ã¯ããéä¿¡ãã®ããã»ã¹ã§ãçºä¿¡ããã¥ã¡ã³ãããªããžã§ã¯ããäœæããããã屿§ã§åããããšã«é²ã¿ãŸããã çä¿¡ãããããã«å€ããããŸãïŒ
屿§
ã«ãŠã³ã¿ãŒããŒãã£
ã顧客ãããã»ã¹ãããã«ãŠã³ã¿ãŒããŒãã£ããªããžã§ã¯ãã«ãªã³ã¯ããŸãã æå¹ãªå±æ§å€ã®åæåã¯ãã¹ã¯ãªããããªããžã§ã¯ãã®åæååŸãã§å®è¡ãããŸãã
cobjectref()->attributeref('crs_management_outgoing_contragent')->values = prepareOutgoingContragents();
è£å©é¢æ°prepareOutgoingContragentsã¯ãããªããžã§ã¯ãã®åæååãã¹ã¯ãªããã§å®£èšãããŠããŸãã
function prepareOutgoingContragents() { $src_contragents = selectAll( 'crm_management', 'crm_management_contragent' ); $end_contragents = array(); foreach ($src_contragents as $s) $end_contragents += array($s['id'] => $s['description']); asort($end_contragents); return $end_contragents; }
éžæããååŒçžæã«å¿ããŠãå©çšå¯èœãªé£çµ¡å
ã®ãªã¹ããšã¬ã¿ãŒãéä¿¡ããããã®æšå¥šã«ãŒã«ã¯ç°ãªããŸãã ãŸããé£çµ¡å
ã®åäœãå
šå¡ã«æãããªå Žåã¯ãéä¿¡ã«ãŒã«ã䜿çšããŠãå
šå¡ã«ã§ã¯ãããŸããã å®éãåœç€Ÿã®è«è² æ¥è
ãç¹ã«é¡§å®¢ã¯ãé»åã¡ãŒã«ã®åä¿¡ã«é¢ããŠéåžžã«äžæ©å«ã§ãã ã¡ãŒã«ã ãã®åäœã®çç±ã説æããã®ã¯é£ããã§ãããããšãã°ãäžéšã®é¡§å®¢ã¯é»åã¡ãŒã«ãåãå
¥ããŸãã æå€§å®¹éã3MBã§ãåæã«100MBã®ãã¹ãŠã®ããã¥ã¡ã³ããã¡ãŒã«ã§ã®ã¿éä¿¡ããå¿
èŠããããŸãã ã¡ãŒã«ã ãã®ä»ã¯ãé»åã¡ãŒã«ãžã®å€§èŠæš¡ãªæè³ã®è»¢éãèš±å¯ããŸãã ããšãã°ãã¬ã¿ãŒã¯10-15MbçšåºŠã§ããããã¹ãŠã®ã¢ããªã±ãŒã·ã§ã³ã¯zip圢åŒã®ã¿ã§ããããã«ãããªã¥ãŒã ã¢ãŒã«ã€ãã§ã¯ãªãããšãå¿
èŠã§ãã ããã«ãã«ããŒã¬ã¿ãŒã¯é»åã¡ãŒã«ã§éä¿¡ããããšäž»åŒµãã人ãããŸãã äŒç€Ÿã®äœæã«éµéãããã¹ãŠã®ã¢ããªã±ãŒã·ã§ã³ãå¥ã®æ¹æ³ã§ä»ã®åä¿¡è
ã«è»¢éããŸããã 4人ç®ã¯ããã©ã€ããŒããªãããŒã«ãäžã®æåã«æ·»ä»ãã¡ã€ã«ãã¢ããããŒãããŠããããããã¹ãŠãããŠã³ããŒãã§ããããã«æ±ããããŸãã æ°é±éåããã顧客ã¯ã¬ã¿ãŒãéä¿¡ãããšãã«ãã¹ãŠã®ã¢ããªã±ãŒã·ã§ã³ãã»ãã¥ã¢
FTPã«è»¢éããããã«ç§ã«èŠæ±ããå¥ã®é¡§å®¢ã¯ãã¹ãŠã®ã¢ããªã±ãŒã·ã§ã³ãšã«ããŒã¬ã¿ãŒãFrontPageã«æã¡äžããŠç¹å®ã®ãã©ã«ããŒã«é
眮ããããŒã¿ã«ã§ãããã«ããŠã³ããŒãããããèŠæ±ããŸããã
éäžçãªéä¿¡ã§ã¯ãæçŽãéä¿¡ããããã«ãã¹ãŠã®é¡§å®¢ã®èŠä»¶ãæåã§æºããããšã¯é£ããããšã¯æããã§ããã ããããããããéåžžã«é£ããã åºå¡ãšGUIã®äž¡æ¹ããç¹å®ã®é¡§å®¢ã«æçŽãéä¿¡ãããã©ãŒã ãèŠããŠããå¿
èŠããããŸãã ããããæ©èœããŸããïŒ
ããã»ã¹ã®ãã¹ãŠã®åå è
ã®äœæ¥ãä¿é²ããããã«ã
easla.comã«ãããã®ãã¹ãŠã®èŠä»¶ãä¿åãããã®ããã«ã
é ãæ©ãŸããå¿
èŠããã
ãŸããã ãã®çµæããCustomersãããã»ã¹ã®ãCounterpartyããªããžã§ã¯ãã«2ã€ã®å±æ§ã远å ããŠæçµæ±ºå®ããŸããã1ã€ã¯æšå¥šéä¿¡ã«ãŒã«ãä¿åããããã®ãã®ïŒè©³çްã¯ä»¥äžïŒããã1ã€ã¯è¿œå ã®é£çµ¡å
ã®ãªã¹ãïŒããã«ã€ããŠã詳现ïŒã§ãã
ã€ãŸããã倿޿ã屿§ã䜿çšãããšãéžæããååŒçžæã«å¿ããŠå±æ§å€ãåå®çŸ©ã§ããŸãã
if (!empty(cattributeref()->value)) { $contacts = cobjectref()->prepareOutgoingContacts(cattributeref()->value); cobjectref()->attributeref('crs_management_outgoing_contact')->values = $contacts; $contracts = cobjectref()->prepareContracts(cattributeref()->value); if (empty($contracts)) $contracts = cobjectref()->prepareContracts(); cobjectref()->attributeref('crs_management_outgoing_contract')->values = $contracts; $default_rule = cobjectref()->calcContragentOutgoingRule(cattributeref()->value); if (!empty($default_rule)) cobjectref()->attributeref('crs_management_outgoing_rule')->value = $default_rule; $default_notifiers = cobjectref()->calcContragentOutgoingNotifiers(cattributeref()->value); if (!empty($default_notifiers)) cobjectref()->attributeref('crs_management_outgoing_notifiers')->value = $default_notifiers;
ãšããã§ãã¹ã¯ãªããã®æåŸã®2è¡ãæè¿è¿œå ãããŸããã ããã¯ããã顧客ããçºä¿¡ææžãèå¥ããããã«åœç€Ÿä»¥å€ã®æå®ã䜿çšããããšãèŠæ±ãããšããäºå®ã«ãããã®ã§ãã ããã«ãã-顧客ïŒ
é£çµ¡å
顧客ããã»ã¹ã®é£çµ¡å
ãªããžã§ã¯ããžã®ãªã³ã¯ã ååŒå
ãªã¹ããšåæ§ã«ãé£çµ¡å
ãªã¹ãã¯ããªããžã§ã¯ããåæåãããåŸãã¹ã¯ãªããã§åæåãããŸãã
$contacts = prepareOutgoingContacts(); cobjectref()->attributeref('crs_management_outgoing_contact')->values = $contacts;
ãã®å Žåãè£å©é¢æ°prepareOutgoingContactsãããªããžã§ã¯ãã®åæååãã¹ã¯ãªããã§å®£èšãããŸãã
function prepareOutgoingContacts($contragent = null) { if (empty($contragent)) $src_contacts = selectAll( 'crm_management', 'crm_management_contact', array('crm_management_contact_contragent.description'), null ); else $src_contacts = selectAll( 'crm_management', 'crm_management_contact', array('crm_management_contact_contragent.description'), array('crm_management_contact_contragent'=>$contragent) ); $end_contacts = array(); $processed_contact = array(); $processed_description = array(); foreach ($src_contacts as $s) { $e = array_search($s['description'], $processed_description); if($e === false) { $processed_contact += array($s['id'] => $s); $processed_description += array($s['id'] => $s['description']); $end_contacts += array($s['id'] => $s['description']); } else { $end_contacts[$e] = $processed_contact[$e]['description'].' ['.trim($processed_contact[$e]['crm_management_contact_contragent.description']).']'; $end_contacts += array($s['id'] => $s['description'].' ['.trim($s['crm_management_contact_contragent.description']).']'); } } unset($processed_contact,$processed_description); asort($end_contacts); return $end_contacts; }
ãIncoming Documentããªããžã§ã¯ãã®ãå§åйãã®ãããªé¢æ°ã¯ããã¹ãŠã®å®å
šãªååã«ãããããåºå¥ã§ããããã«äœæ¥ããçµç¹ã®ååã远å ããŸãã
å©äŸ¿æ§ãé«ããããã«ãã倿޿ãé£çµ¡å
ããã³æå®ãããŠããªãã«ãŠã³ã¿ãŒããŒãã£ã¹ã¯ãªããã¯ãå¿
èŠãªã«ãŠã³ã¿ãŒããŒãã£ã眮ãæããããã«äŸåãã屿§ã®å€ãæŽæ°ããŸãã
if (empty(cobjectref()->attributeref('crs_management_outgoing_contact')->value)) return; if (empty(cobjectref()->attributeref('crs_management_outgoing_contragent')->value)) { $contact = select(cobjectref()->attributeref('crs_management_outgoing_contact')->value); if (empty($contact)) return; $contragent_id = $contact->attributeref('crm_management_contact_contragent')->value; cobjectref()->attributeref('crs_management_outgoing_contragent')->value = $contragent_id; $contracts = cobjectref()->prepareContracts($contragent_id); if (empty($contracts)) $contracts = cobjectref()->prepareContracts(); cobjectref()->attributeref('crs_management_outgoing_contract')->values = $contracts; $default_rule = cobjectref()->calcContragentOutgoingRule($contragent_id); if (!empty($default_rule)) cobjectref()->attributeref('crs_management_outgoing_rule')->value = $default_rule; $default_notifiers = cobjectref()->calcContragentOutgoingNotifiers($contragent_id); if (!empty($default_notifiers)) cobjectref()->attributeref('crs_management_outgoing_notifiers')->value = $default_notifiers; } cobjectref()->attributeref('crs_management_outgoing_cntnum')->value = cobjectref()->updateDocumentCntNum(); cobjectref()->attributeref('crs_management_outgoing_regnum')->value = cobjectref()->calcOutgoingCode();
çµæã¯æ¬¡ã®ããã«ãªããŸãã

远å ããŸãã é£çµ¡å
顧客ããã»ã¹ã®é£çµ¡å
ãªããžã§ã¯ããžã®ãªã³ã¯ã ããã¯ãã¡ã€ã³ã®åä¿¡è
ã«æçŽãéä¿¡ãããšãã«ã³ããŒã«è¿œå ããã远å ã®é£çµ¡å
ã®ãªã¹ãã§ãã ãã®å±æ§ã§ã¯ããã«ãŠã³ã¿ãŒããŒãã£ããªããžã§ã¯ãã§æå®ãããé£çµ¡å
ãæžã蟌ãŸããç¹å®ã®çžæã«éä¿¡ãããå Žåãã¬ã¿ãŒã®ã³ããŒãéä¿¡ãããŸãã
å®è£
ã¯éåžžã«äŸ¿å©ã§ããããšã倿ããŸããã 以åã¯ãåºå¡ãšGUIãã¢ãã¿ãŒãç²ççŽã§æ¥çãããã®äžã«é¡§å®¢ã®ååãšæçŽã®ã³ããŒãéãçžæã®ãªã¹ããæžãããŠããŸããã è«æã®ä»£ããã«ã
easla.comã䜿çšãããããã«ãªããã³ããŒã§é£çµ¡å
ã瀺ãããšãå¿ããªãããã«ãªããŸããã
远å ããŸãã ã¡ãŒã«ã§éç¥ãã ã¡ãŒã«
顧客ããã»ã¹ã®é£çµ¡å
ãªããžã§ã¯ããžã®ãªã³ã¯ã 远å ã®å¥ã®ãªã¹ãã é£çµ¡å
ãæçŽã®ã³ããŒã§å¥ééç¥ããå¿
èŠããããŸãã å€ãã®å Žåãããã¯é¡§å®¢ã®åŸæ¥å¡ã§ã¯ãªãã芪çµç¹ãŸãã¯èŠå¶æ©é¢ã®åŸæ¥å¡ã§ãããããŸãã
çºéã«ãŒã«
ååäººã«æçŽãéãæ¹æ³ã決å®ã§ããåé¡åã çŸåšãŸã§ã«ã16ã®éä¿¡ã«ãŒã«ã䜿çšããŠããŸãã ããã€ãã®éãã¯æ°åã®ã¿ã§ããäŸïŒ
- ãã¹ãŠãå
šå¡ã«éä¿¡ããŸãïŒ3Mb以äžïŒ
- ææžããã¥ã¡ã³ã é£çµ¡å
ãä»ã®ãã¹ãŠã®ãã®ïŒ5M以äžã4.5Mã®ã¢ãŒã«ã€ãïŒ
- å
šå¡ã«ã¢ãŒã«ã€ããžã®ãªã³ã¯ãæçŽãšæ·»ä»ãã¡ã€ã«ã§éä¿¡ããŸã
- ææžããã¥ã¡ã³ã é£çµ¡å
ãä»ã®ãã¹ãŠã®äººã«æçŽãšæ·»ä»ãã¡ã€ã«ä»ãã®ã¢ãŒã«ã€ããžã®ãªã³ã¯
- ãã¹ãŠã®äººã«ãã¹ãŠãéä¿¡ããïŒ3Mã2.5M以äžã®ã¢ãŒã«ã€ãïŒ
- OOOã顧客ãã®ãã¹ãŠãftp.sngp.ruã«è»¢éããŸã
- ããŒã¿ã«pro.blablabla.ruãžã®ãªã³ã¯ãšããŠãã¹ãŠãéä¿¡ããŸã
æå¹ãªå€ã®ãªã¹ãã¯ã屿§ãåæåæãã®ã¹ã¯ãªããã§åœ¢æãããŸãã
$src_classificators = classificatorChilds('crs_outgoing_rule'); $end_classificators = array(); $default = 'crs_outgoing_rule_asis_max5'; $default_index = null; foreach($src_classificators as $c) { $end_classificators += array($c['id']=>$c['name']); if ($c['code'] == $default) $default_index = $c['id']; } if (count($end_classificators) > 0) { cattributeref()->values=$end_classificators; cattributeref()->value = is_null($default_index) ? key($end_classificators) : $default_index; }
䟿å©ãªclassificatorChilds颿°ã¯ãæå®ãããåé¡åã®çŽæ¥ã®åãè¿ããŸãã å€ããœãŒãããŠé
åã圢æãã屿§ã«å²ãåœãŠãã ãã§ãã
éä¿¡ã«ãŒã«ã¯ãã¢ã¯ã·ã§ã³ã§ãã¡ãŒã«ã§éä¿¡ããŸãã 以äžã«èª¬æããŸãã
ç»é²æ¥
ååãããçºä¿¡ããã¥ã¡ã³ãã®ç»é²æ¥ãä¿åãããŠããããšãæããã§ãã åæå€ã¯çŸåšã®æ¥ä»ã«å¯Ÿå¿ãããåæåæã屿§ã®ã¹ã¯ãªããã§åæåãããŸãã
cobjectref()->attributeref('crs_management_outgoing_regdate')->value = currentDateTime();
çºéæ¥
ãŸããååããã屿§ã«éä¿¡æ¥ãæ ŒçŽãããŠããããšãæããã§ãã èªã¿åãå°çšãã€ãŸã ãŠãŒã¶ãŒèªèº«ãèšå
¥ããããšã¯ã§ããŸããã ãèªã¿åãå°çšãã¢ãŒãã§ã¯ã屿§ã¯ãåæåæãã¹ã¯ãªããã§å€æãããŸãã
cattributeref()->readonly = true;
åºæŒè
ã¬ã¿ãŒã®äœæã«é¢äžããçµç¹ã®ãŠãŒã¶ãŒïŒåŸæ¥å¡ïŒã è€æ°ã®åŸæ¥å¡ãã¬ã¿ãŒã®éçºã«åå ã§ããããã屿§ã¯è€æ°ã§ãã ã¬ã¿ãŒã®ç»é²ïŒäœæïŒæã«ãçŸåšã®ãŠãŒã¶ãŒãèå¥ãããã³ãŒãã«ç€ºãããã°ã«ãŒãã«ãã£ãŠèŒªéãæãããçããµãŒã¯ã«ã«å±ããŠããªãå Žåã屿§å€ã«æžã蟌ãŸããŸãã åŸç¶ã®ååŸæ¥å¡ã¯ãæçŽã®éä¿¡ã«é¢ããæ
å ±ãåãåãããå Žåãããã©ãŒããŒã®ãªã¹ãã«èªåã远å ããå¿
èŠããããŸãã ãšããã§ãåºæŒè
ã¯ããã£ãŒãããã¯ã®ããã«é»è©±ã瀺ãçºä¿¡ã¬ã¿ãŒãã©ãŒã ã®æåŸã«ç€ºãããŸãã
æå¹ãªå±æ§å€ã®åæåã¯ãã¹ã¯ãªãããåæåäžãã§è¡ãããŸãã
$src_users = corganization()->allUsers(); $end_users = array(); foreach($src_users as $u) if ($u['islocked'] == 0) $end_users += array($u['id']=>$u['description']); asort($end_users); cobjectref()->attributeref('crs_management_outgoing_performers')->values = $end_users; if (!empty(cuser())) { $rsp_users = corganization()->allUsersByGroups(array( 'group_general_manager', 'group_general_engineer', 'group_general_manager_operations', 'group_general_manager_economics', 'group_gip', 'group_hr', 'group_dp' ), null); $f = true; foreach($rsp_users as $u) if ($u['id'] == cuser()->id) { $f = false; break; } if ($f) { cobjectref()->attributeref('crs_management_outgoing_performers')->value = cuser()->id; cobjectref()->updateResponsibleGroup(); } }
è£å©é¢æ°updateResponsibleGroupã¯ã屿§ãReplyãã®å€ãæŽæ°ããããã«èšèšãããŠããŸãã ãŠããããããã³ã¹ã¯ãªããã§å®£èšãããããªããžã§ã¯ãã®åæååãïŒ
function updateResponsibleGroup() { if (empty(cobjectref()->attributeref('crs_management_outgoing_performers')->value)) return; if (empty(cobjectref()->attributeref('crs_management_outgoing_responsiblegroup')->value)) { $performers = cobjectref()->attributeref('crs_management_outgoing_performers')->value; $user = corganization()->user($performers[0]); if (empty($user)) return; $groups = $user->groups(); foreach($groups as $group) if (!empty($group['data_one'])) { cobjectref()->attributeref('crs_management_outgoing_responsiblegroup')->value = $group['id']; break; } } }
屿§å€ã倿Žããããšãã倿޿ãã¹ã¯ãªãããããªã¬ãŒãããçºä¿¡ããã¥ã¡ã³ãã®åœ¢åŒã§è²¬ä»»ãŠããããæŽæ°ãããŸãã
if (!empty(cobjectref()->attributeref('crs_management_outgoing_performers')->value) && empty(cobjectref()->attributeref('crs_management_outgoing_responsiblegroup')->value)) cobjectref()->updateResponsibleGroup();
ç¹°ãè¿ã åŸæ¥å¡
çºä¿¡ã¬ã¿ãŒã«çœ²åããçµç¹ã®ãŠãŒã¶ãŒïŒåŸæ¥å¡ïŒã ç§ãã¡ã®å Žåãå
¬åŒã®æçŽã¯äžçŽç®¡çè·ã人äºéšé·ãããã³ISUã«ãã£ãŠã®ã¿çœ²åãããŸãã è³æ Œã®ããåŸæ¥å¡ã®ãªã¹ãã¯ãã¹ã¯ãªãããåæåäžãã§äœæãããŸãã
$src_users = corganization()->allUsersByGroups(array( 'group_general_manager', 'group_general_engineer', 'group_general_manager_operations', 'group_general_manager_economics', 'group_gip_only', 'group_hr' ), null); $end_users = array(); foreach($src_users as $u) if ($u['islocked'] == 0) $end_users += array($u['id']=>$u['description']); asort($end_users); cobjectref()->attributeref('crs_management_outgoing_responsibleuser')->values = $end_users;
allUsersByGroups颿°ã¯ãç¹å®ã®ã°ã«ãŒãã«å±ãããŠãŒã¶ãŒã®ãªã¹ããååŸããå¿
èŠãããå ŽåïŒãŸãã¯ãã®éã®å ŽåïŒã®åãªãåœã®æ©äººã§ãã
屿§ã倿Žããããšã屿§ãReplyã ãŠããããã ååšããªãå Žåãã€ãŸã è«è² æ¥è
ã¯æžç°¡ã«ç€ºãããŠããããéšéãé¢ä¿ããŠãããŠããããèšé²ãããŠããŸãã åŸæ¥å¡ïŒ
if (!empty(cattributeref()->value) && empty(cobjectref()->attributeref('crs_management_outgoing_responsiblegroup')->value)) { $user = corganization()->user(cattributeref()->value); $groups = $user->groups(); foreach ($groups as $group) if (is_numeric($group->data_one)) { cobjectref()->attributeref('crs_management_outgoing_responsiblegroup')->value = $group->id; break; } } cobjectref()->attributeref('crs_management_outgoing_regnum')->value = cobjectref()->calcOutgoingCode();
easla.comã§ãã®ãããªåçãªãã©ãŒã ãäœæããæ©äŒã«éåžžã«æºè¶³ããŠããŸãã äžéšã®å±æ§ã®å€ã倿Žããããšã«ãããä»ã®å±æ§ã®å€ãä»»æã®é åºã§å€æŽã§ããŸãïŒ ããšãã°ãSharePointã§åãããšã詊ããŠãã ããã
ç¹°ãè¿ã ãŠããã
ç§ãã¡ã®å ŽåããŠãŒã¶ãŒã®ã°ã«ãŒãã¯ãçºä¿¡ããã¥ã¡ã³ãã®éçºãæ
åœããçµç¹ã®åäœã§ãã
çµç¹å
ã®ãã¹ãŠã®ãŠãããã«ã¯ã人äºéšéã«ãã£ãŠå²ãåœãŠãããç¬èªã®æ°å€ïŒå°æ°ïŒèå¥åããããŸãã ããããããããã¯ã©ããã§äœ¿çšãããŸãããç§ã®å Žåã¯ãéä¿¡ã¡ãã»ãŒãžãèå¥ããããã«äœ¿çšãããŸãã ãã®ãããeasla.comã§ãŠãŒã¶ãŒã®ã°ã«ãŒããäœæãããšãã«ããããã®èå¥åããããããæåã®ããŒã¿ãã«å
¥åããŸããã

å¯èœãªåçã®ãªã¹ããäœæãããšãã ãåæåæãã¹ã¯ãªããã¯ããæåã®ããŒã¿ãã®ååšããã§ãã¯ããã°ã«ãŒããååšããå Žåã®ã¿ãªã¹ãã«å«ããŸãã
$src_groups = corganization()->groups(); $end_groups = array(); foreach($src_groups as $g) if (!empty($g['data_one'])) $end_groups += array($g['id']=>$g['name']); asort($end_groups); cobjectref()->attributeref('crs_management_outgoing_responsiblegroup')->values = $end_groups;
穎ãå€ãããšã äžäœåºåã¯ãçºä¿¡ããã¥ã¡ã³ãã®ç»é²çªå·ã®æå®ã倿ŽããŸãã
cobjectref()->attributeref('crs_management_outgoing_regnum')->value = cobjectref()->calcOutgoingCode();
calcOutgoingCodeãã«ããŒé¢æ°ã¯ãããªããžã§ã¯ãã®åæååãã¹ã¯ãªããã§å®£èšãããŠããŸãã
function calcOutgoingCode() { if (empty(cobjectref()->attributeref('crs_management_outgoing_contragent')->value)) return; if (empty(cobjectref()->attributeref('crs_management_outgoing_cntnum')->value)) return; if (!empty(cobjectref()->attributeref('crs_management_outgoing_content')->value) && cobjectref()->attributeref('crs_management_outgoing_contragent')->value == 45410 && cobjectref()->attributeref('crs_management_outgoing_content')->value == 1192) {
æè¿ãŸã§ããã®æ©èœã¯ã¯ããã«ã·ã³ãã«ã§ããããæè¿ã®èŠä»¶ã«ããã顧客IDãšæçŽã®çš®é¡ãèæ
®ããŠå€æŽããå¿
èŠããããŸããã å
¥åããã屿§ã«åŸã£ãŠã颿°ã¯ææžç»é²çªå·ã圢æããŸãã
ã·ãªã¢ã«çªå·
éä¿¡ããã¥ã¡ã³ãã®ã·ãªã¢ã«çªå·ã¯ãæ¯å¹Žåã³çªå·ä»ããéå§ããŸãã ãããã£ãŠãçµã¿èŸŒã¿ã®
easla.comçªå·ä»ãããã€ã¹ã䜿çšããããšã¯ã§ããŸããã§ããã ç§ã¯èªåã§æžããªããã°ãªããŸããã§ããã
ããã«ã顧客ã®1人ããç¹å®ã®çš®é¡ã®æåã«å¯ŸããŠãšã³ãããŒãšã³ãã®çªå·ä»ãã®äœ¿çšãèŠæ±ãããããçªå·ä»ãã¯äºéã«ãªã£ãŠããŸãã ç»é²çªå·ãèšèŒãããæçŽã®å Žåã¯éåžžã顧客ãèŠæ±ããç»é²çªå·ãèšèŒãããæçŽã®å Žåã¯ç°åžžã§ãã
çºä¿¡ããã¥ã¡ã³ããäœæãããšããåæã·ãŒã±ã³ã¹çªå·ãèšç®ãããŸãïŒ
cattributeref()->value = cobjectref()->updateDocumentCntNum();
è£å©é¢æ°updateDocumentCntNumã¯ãããªããžã§ã¯ãã®åæååãã¹ã¯ãªããã§ã宣èšãããŠããŸãã
function updateDocumentCntNum() { if (cobjectref()->isNewRecord || empty(cobjectref()->attributeref('crs_management_outgoing_cntnum')->value)) { if (!empty(cobjectref()->attributeref('crs_management_outgoing_contragent')->value) && !empty(cobjectref()->attributeref('crs_management_outgoing_content')->value) && cobjectref()->attributeref('crs_management_outgoing_contragent')->value == 45410 && cobjectref()->attributeref('crs_management_outgoing_content')->value == 1192) { $num = selectAggregateAll( 'max', 'crs_management', 'crs_management_outgoing', 'crs_management_outgoing_cntnum', array( 'crs_management_outgoing_contragent'=>array('id',cobjectref()->attributeref('crs_management_outgoing_contragent')->value), 'crs_management_outgoing_content'=>array('id',cobjectref()->attributeref('crs_management_outgoing_content')->value) ) ); return $num + 1; } $year = date_format(currentDateTime(), 'Y'); $condition = array( 'crs_management_outgoing_regdate'=>array('between', $year.'-01-01', $year.'-12-31'), ); switch ($year) { case '2016': $condition['crs_management_outgoing_cntnum'] = '<4489'; $tmp = selectAggregateAll( 'max', 'crs_management', 'crs_management_outgoing', 'crs_management_outgoing_cntnum', $condition ); if ($tmp == 4488) { unset($condition['crs_management_outgoing_cntnum']); } else { return $tmp + 1; } break; } $num = selectAggregateAll( 'max', 'crs_management', 'crs_management_outgoing', 'crs_management_outgoing_cntnum', $condition ); return $num + 1; } else { return cobjectref()->attributeref('crs_management_outgoing_cntnum')->value; } }
ã³ãŒããããèŠããšãå¥åŠãªã±ãŒã¹ã2016ãã®ç¶æ
ãããããŸãã ããã¯ç§ãã¡ã®å
éšåé¡ã®çµæã§ãã ãŸããããã¥ã¡ã³ããé¡åç
ã«ç»é²ãã
å¯èœæ§ãããããã
easla.comã§ã¯äžæ£è¡çºã®è©Šã¿ããã«ãããªããããŸããã§ããã ã€ãŸãããã¹ãŠã¯ãŠãŒã¶ãŒã®è²¬ä»»ã§ãã ãã®ããã圌ãã¯ä»å¹Žã®åãã«æšå¹Žã®æ°åã§æçŽãäœæããŸããã ãããŠããªããšãéä¿¡ããããšããã§ããŸããïŒ ä»å¹Žãæåã«æ£ããçªå·ãä»ããããã«ãæ¡ä»¶ãèšå®ãããã®ãããªæåãåæããå¿
èŠããããŸããã
å¥ã«ãselectAggregateAll颿°ã«æ³šæãæããŸãã ç§ã®å Žåãããã»ã¹ãcrs_managementãã®ãªããžã§ã¯ããcrs_management_outgoingãã®å±æ§ãcrs_management_outgoing_cntnumãã®æå€§æ°å€ã§ããéèšå€ãè¿ããŸãã ããã¯ãæ€çŽ¢æ¡ä»¶$æ¡ä»¶ã䜿çšããŸããããã¯ãå°ãé«ã圢åŒã§ãã
åããšã«ãã§ãåé¿çãæ¯æããŠåæ§ã®æ¹æ³ãæŸæ£ããªããã°ãªããŸããã§ããã ãããã©ãã ã£ããã§ãïŒ
æ£ãããããšã«ãã®ãã¬ãŒãã³ãŒã var manager = EntityManager<IOutgoingDoc>.Instance; DateTime startdate = new DateTime(entity.RegDate.Value.Year, 1, 1); DateTime enddate = new DateTime(entity.RegDate.Value.Year, 12, 31); var allInYear = from d in manager.FindAll() where d.RegDate.Value >= startdate && d.RegDate.Value <= enddate orderby d.CntNum select d; if (allInYear.Count() == 0) entity.CntNum = 1; else entity.CntNum = allInYear.Last().CntNum + 1;
ãšãããããã¹ãŠã¯ããŸããããŸããããããããéåžžã«é
ããªãå§ããã®ã§ãããã«ããã¯ãæ¢ãå¿
èŠããããŸããã ãã®ãããªå Žæã®1ã€ã¯ãã·ãªã¢ã«çªå·ã®èšç®ã§ããããšã倿ããŸããã 远å ãäœæããå¿
èŠããããŸããã ããŒãã«ãšã³ãŒãã眮ãæããŠããªããžã§ã¯ããšã·ã¹ãã å
šäœã®é床ãåäžãããŸãã
ãšã«ãã®åé¿ç string ConString = "Data Source=ss2;Initial Catalog=ELMA;User ID=sa;Password=password;"; using (SqlConnection connection = new SqlConnection(ConString)) { using (SqlCommand command = connection.CreateCommand()) { var year = entity.RegDate.Value.Year; command.CommandText = "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; SELECT TOP 1 cntNum FROM [ELMA].[dbo].[OutgoingDoc] WHERE (RegDate >= CAST('" + year.ToString() + "-01-01 00:00:00' AS datetime)) AND (RegDate < CAST('" + year.ToString() + "-12-31 23:59:59' AS datetime)) ORDER BY cntNum DESC"; connection.Open(); SqlDataReader reader = command.ExecuteReader(); var cntNum = 0; if (reader.Read()) cntNum = int.Parse(reader[0].ToString()); connection.Close(); command.CommandText = "SELECT TOP 1 reservedNum FROM [TNGP].[dbo].[ElmaReservedNums] WHERE docType = '" entity.TypeUid + "' ORDER BY reservedNum DESC"; connection.Open(); reader = command.ExecuteReader(); var reservedNum = 0; if (reader.Read()) reservedNum = int.Parse(reader[0].ToString()); connection.Close(); if (cntNum < reservedNum) cntNum = reservedNum; if (cntNum == 0) cntNum = 1; else cntNum++; command.CommandText = "INSERT INTO [TNGP].[dbo].[ElmaReservedNums](reservedNum, docType) VALUES (" + cntNum.ToString() + ",'" + entity.TypeUid + "')"; connection.Open(); command.ExecuteNonQuery(); connection.Close(); entity.CntNum = cntNum; } }
ããã¯æ¬åœã§ããïŒïŒ
ç»é²çªå·
å¿
é ã®èªã¿åãå°çšããã¹ã屿§ã éä¿¡ããã¥ã¡ã³ãã®ç»é²çªå·ãæ ŒçŽããŸãã åæåæã«èšç®ïŒ
cattributeref()->readonly = true; cattributeref()->value = cobjectref()->calcOutgoingCode();
å€ãããã¥ã¡ã³ãç»é²çªå·ã«åœ±é¿ããä»ã®å±æ§ã倿ŽããããšæŽæ°ãããŸãã

ããŒã
ãã¬ãŒã³ãªè€æ°è¡ã®å¿
é ããã¹ã屿§ã
ã³ã³ãã³ãã®çš®é¡
ã¬ã¿ãŒã®ã³ã³ãã³ãã®ã¿ã€ããå€å¥ã§ããåé¡åã çä¿¡ææžãšãŸã£ããåãã æå¹ãªå€ã®ãªã¹ãã¯ããåæåæãã«åœ¢æãããŸãã
$src_classificators = classificatorChilds('crs_content'); $end_classificators = array(); foreach($src_classificators as $c) { $end_classificators += array($c['id']=>$c['name']); if ($c['code'] == 'crs_content_other') $default = $c['id']; } if (count($end_classificators) > 0) { cattributeref()->values=$end_classificators; cattributeref()->value = isset($default) ? $default : $c['id']; }
, , .
if (cobjectref()->attributeref('crs_management_outgoing_contragent')->value == 45410) cobjectref()->attributeref('crs_management_outgoing_cntnum')->value = cobjectref()->updateDocumentCntNum(); cobjectref()->attributeref('crs_management_outgoing_regnum')->value = cobjectref()->calcOutgoingCode();
« » . , "
" « ». --- ..
, , , . «».
« »:
cattributeref()->values = cobjectref()->prepareIncomings();
prepareIncomings « »:
function prepareIncomings() { $src_documents = selectAll( 'crs_management', 'crs_management_incoming', array('crs_management_incoming_contragent_regnum') ); $end_documents = array(); foreach ($src_documents as $d) $end_documents += array($d['id'] => $d['crs_management_incoming_contragent_regnum'].' ['.$d['description'].']'); asort($end_documents); return $end_documents; }
«» «». , "
" « ».
« », :
cobjectref()->attributeref('crs_management_outgoing_contract')->values = prepareContracts();
, , .
, .. , .. . , , , - .
. âŠ
..
. , . .
. , , , .
« »:
cattributeref()->revMode = true; cattributeref()->canScan = true; cattributeref()->fileLinks = 3;
. revMode , / ().

canScan , .

fileLinks=3 , , (
Easla Agent ). , , . 0, .. , . 1 â , . , .. , , 2 â , . . 3 â , (. ).
,
easla.com . . . .

, , , Microsoft Word, . , , . , , . Microsoft Word .

, .. , , :
cobjectref()->updateDocumentFileName();
. , , , , , , .
, « »:
function calcOutgoingDesc() { $code = calcOutgoingCode(); if (empty($code)) return; if (empty(cobjectref()->attributeref('crs_management_outgoing_sentdate')->value)) { $d = date_create(cobjectref()->attributeref('crs_management_outgoing_regdate')->value); } else { $d = date_create(cobjectref()->attributeref('crs_management_outgoing_sentdate')->value); } return sprintf( '%s %s', $code, localeFormatDate($d) ); } function updateDocumentFileName() { $desc = calcOutgoingDesc(); if (empty($desc)) return; $files = cobjectref()->attributeref('crs_management_outgoing_document')->availableFiles(); foreach ($files as $f) { $nowname = sprintf( '%s.%s', $desc, pathinfo($f->nowname, PATHINFO_EXTENSION) ); if (strcmp($nowname, $f->nowname) == 0) continue; $f->nowname = $nowname; $f->save(); } }
calcOutgoingDesc .
çšé
. , . « » :
if (cattributeref()->filesCount > 10) cattributeref()->fileInfo = array('revcode','modifytime','count','total','header','filter'); else cattributeref()->fileInfo = array('revcode','modifytime','count','total');
, . ã¡ãŒã«ã
,
TDMS , - . . , , . ,
TDMS easla.com , , .
:
, 2 5 . 10 , ! æªå€¢ïŒ
,
TDMS , , !
, ,
easla.com TDMS . ,
TDMS , . , (
easla.com SOAP ), !

, . , !
- . , .
. , . â Transmittal.
察象
, , . « »:
switch (cobjectref()->status->code) { case 'crs_management_outgoing_created': cobjectref()->status->state = 1; break; case 'crs_management_outgoing_fax': case 'crs_management_outgoing_courier': case 'crs_management_outgoing_narochnym': case 'crs_management_outgoing_post': cobjectref()->status->state = 2; break; case 'crs_management_outgoing_email': cobjectref()->status->state = 4; break; }
åæããŠãè²ã¯æå¿«ãã远å ããŸãã
ãªããžã§ã¯ãã®å±æ§ã®æçµæ€èšŒã¯ãããªããžã§ã¯ããä¿åããåã«ãã¹ã¯ãªããã§è¡ãããŸãã cobjectref()->attributeref('crs_management_outgoing_regnum')->value = calcOutgoingCode(); cobjectref()->description = calcOutgoingDesc(); updateDocumentFileName(); if (!empty(cobjectref()->attributeref('crs_management_outgoing_cntnum')->value)) { if (cobjectref()->attributeref('crs_management_outgoing_contragent')->value == 45410 && cobjectref()->attributeref('crs_management_outgoing_content')->value == 1192) { $conditions = array( 'crs_management_outgoing_contragent'=>array('id',cobjectref()->attributeref('crs_management_outgoing_contragent')->value), 'crs_management_outgoing_content'=>array('id',cobjectref()->attributeref('crs_management_outgoing_content')->value), 'crs_management_outgoing_cntnum'=>cobjectref()->attributeref('crs_management_outgoing_cntnum')->value ); if (!cobjectref()->isNewRecord) $conditions['id'] = '<>'.cobjectref()->id; $exist = selectCountAll('crs_management','crs_management_outgoing', $conditions); if ($exist) { $nownum = cobjectref()->attributeref('crs_management_outgoing_cntnum')->value; $freenum = updateDocumentCntNum(); cobjectref()->attributeref('crs_management_outgoing_cntnum')->value = $freenum; cobjectref()->attributeref('crs_management_outgoing_regnum')->value = calcOutgoingCode(); updateDocumentFileName(); throw new Exception(' , .. . '.$nownum.'! '.$freenum.', .'); } } else { $year = date_format(date_create(cobjectref()->attributeref('crs_management_outgoing_regdate')->value), 'Y'); $conditions = array( 'crs_management_outgoing_cntnum'=>cobjectref()->attributeref('crs_management_outgoing_cntnum')->value, 'crs_management_outgoing_regdate'=>array('between', $year.'-01-01', $year.'-12-31') ); if (!cobjectref()->isNewRecord) $conditions['id'] = '<>'.cobjectref()->id; $exist = selectCountAll('crs_management','crs_management_outgoing', $conditions); if ($exist) { $nownum = cobjectref()->attributeref('crs_management_outgoing_cntnum')->value; $freenum = updateDocumentCntNum(); cobjectref()->attributeref('crs_management_outgoing_cntnum')->value = $freenum; cobjectref()->attributeref('crs_management_outgoing_regnum')->value = calcOutgoingCode(); updateDocumentFileName(); throw new Exception(' , .. . '.$nownum.' '.$year.' ! '.$freenum.', .'); } } } if (cobjectref()->status->code == 'crs_management_outgoing_create') { cobjectref()->status = 'crs_management_outgoing_created'; cobjectref()->flags = 1; } else { cobjectref()->flags = 0; }
ããã§ããªããžã§ã¯ãã®ã¹ããŒã¿ã¹ãå€ãããŸããããªããžã§ã¯ãã®ä¿ååŸãã¹ã¯ãªããã§ã¯ãä¿åããããªããžã§ã¯ããžã®æš©éãå²ãåœãŠãããŸãã if (empty(cobjectref()->crs_management_outgoing_responsibleuser)) return; if (empty(cobjectref()->crs_management_outgoing_responsiblegroup)) return; $ruser = corganization()->user(cobjectref()->crs_management_outgoing_responsibleuser); if (empty($ruser)) return; $rgroup = corganization()->group(cobjectref()->crs_management_outgoing_responsiblegroup); if (empty($rgroup)) return; $rugroups = $ruser->groups(); foreach ($rugroups as &$rug) $rug = $rug['code']; if ($rgroup->code == 'group_general_manager' && in_array($rgroup->code, $rugroups)) { $c = classificator(cobjectref()->attributeref('crs_management_outgoing_content')->value);
ãã©ãŒã
easla.com . . , . «» «», .
: . , : , .. . , . , .

, , , . :
:
, , , . , , .. . , .
, â , . , «» «» .
[âŠ]
, , :
, :
if (empty(cobjectref()->attributeref('crs_management_outgoing_sentdate')->value)) { cobjectref()->attributeref('crs_management_outgoing_sentdate')->value = currentDateTime(); } cobjectref()->status = 'crs_management_outgoing_courier'; $msg = cobjectref()->commentTasks(); if (!empty($msg)) echo implode('',$msg);
'crs_management_outgoing_courier' .
.
, «. » . , , . . . :
$contacts = cobjectref()->prepareOutgoingContacts(); asort($contacts); cobjectref()->attributeref('crs_management_outgoing_recipients')->values = $contacts;
远å ããŸãã
. , . :
if (!empty(cobjectref()->attributeref('crs_management_outgoing_contragent')->value)) { $contacts = cobjectref()->prepareOutgoingContacts(cobjectref()->attributeref('crs_management_outgoing_contragent')->value); cobjectref()->attributeref('crs_management_outgoing_recipients')->values = $contacts; }
, « » prepareOutgoingContacts. â , â . , «» , «».
, , , . , , ! :
if (empty(cobjectref()->crs_management_outgoing_performers)) throw new Exception(' . !'); if (empty(cobjectref()->crs_management_outgoing_contragentdate)) throw new Exception(' !'); if (cobjectref()->hasAttributeref('crs_management_outgoing_contragentperson') && empty(cobjectref()->crs_management_outgoing_contragentperson)) throw new Exception(' !'); cobjectref()->description = cobjectref()->calcOutgoingDesc(); $to = corganization()->users(cobjectref()->crs_management_outgoing_performers); $body = array( ' !', ' ', ': '.cobjectref()->viewLink(), ': '.cobjectref()->crs_management_outgoing_subj, ' .', ': '.(cobjectref()->hasAttributeref('crs_management_outgoing_contragentperson') ? cobjectref()->crs_management_outgoing_contragentperson : ''), ' : '.cobjectref()->crs_management_outgoing_contragentdate, ' ', ' ,', cuser()->description ); $options = array( 'from'=>cuser(), 'to'=>$to, 'subj'=>' '.cobjectref()->description, 'body'=>implode('',$body), ); $options['bcc'] = cuser(); sendEmail($options); $message = array(); foreach ($to as $u) $message[] = $u->viewLink(); echo ' :'.implode('', $message);
,
easla.com . sendMail ! , . ãã¹ãŠãã·ã³ãã«ã§ãïŒ
. , . , , « ».
easla.com , «» , . , . . . .
. , , . :
$odt = date_create(); $cdt = date_add(date_create(), new DateInterval('P1D')); $share = shareFiles( cobjectref(), array('crs_management_outgoing_document','crs_management_outgoing_attachments'), $odt, $cdt, cuser(), 'CP866' ); if (empty($share)) throw new Exception(" !"); echo ' : '.$share->link();
, , .

- , . , « . » . ããã¯èµ·ãããŸã...
, , . :
cobjectref()->status = 'crs_management_outgoing_created';
, , . «» . :
$new_notification = new Objectref(); $new_notification->prepare(objectDef('tsk_management','tsk_notification')); $new_notification->attributeref('tsk_notification_subj')->value = ' '.cobjectref()->description; $new_notification->attributeref('tsk_notification_base')->value = cobjectref()->id; caction()->redirect = urlNewObjectref($new_notification);
. , , «», :
$subj = ''; if (!empty(cobjectref()->attributeref('crs_management_outgoing_subj')->value)) $subj = $subj.(strlen($subj) > 0 ? ' ' : '').cobjectref()->attributeref('crs_management_outgoing_subj')->value; $new_task = new Objectref(); $new_task->prepare(objectDef('tsk_management','tsk_task')); $new_task->attributeref('tsk_task_subj')->value = $subj; $new_task->attributeref('tsk_task_base_open')->value = cobjectref()->id; caction()->redirect = urlNewObjectref($new_task);
, , . ! , ! !
.
! . ! , , .
, , 3 , 200 . , .. « » . , , , - / / , , , :
â , ! ãé¡ãïŒ
â ? !
â ?
â , .
â ?
â !
. 9 . . . « . ». 5! , 3 !
, , PHP :
- . if (empty(cobjectref()->attributeref('crs_management_outgoing_regnum')->value)) throw new Exception(' !'); if (empty(cobjectref()->attributeref('crs_management_outgoing_subj')->value)) throw new Exception(' !'); function contactEmail($contact) { if (empty($contact)) return false; $emails = $contact->attributeref('crm_management_contact_email')->value; if (empty($emails)) return false; return $emails[0]; } function contragentEmail($contagent) { if (empty($contagent)) return false; $emails = $contagent->attributeref('crm_management_contragent_email')->value; if (empty($emails)) return false; return $emails[0]; } function getEmail($contact) { $e = contactEmail($contact); if ($e === false) { if (empty($contact->attributeref('crm_management_contact_contragent')->value)) throw new Exception(" ".$contact->viewLink()); $contragent = select($contact->attributeref('crm_management_contact_contragent')->value); $e = contragentEmail($contragent); } return $e === false ? false : array($e => $contact->description); } function getMainEmail($contact) { $e = contactEmail($contact); if ($e === false) $email_1 = false; else $email_1 = array($e => $contact->description); $contragent = select($contact->attributeref('crm_management_contact_contragent')->value); $e = contragentEmail($contragent); if ($e === false) $email_2 = false; else $email_2 = array($e => $contragent->description); $emails = array(); if ($email_1) $emails += $email_1; if ($email_2) $emails += $email_2; unset($email_1, $email_2); return $emails === array() ? false : $emails; } function sendEmailDocumentOnly(&$msg, $objref, $to, $cc, $user, $checkSize = 5120000, $maxSize = '4500k', $extra_msg = '') { $dfs = $objref->attributeref('crs_management_outgoing_document')->filesSize; $body = array( ' !', ' ', ' .', easla.com ' '.$objref->description.'.', $extra_msg, ', @sngp.ru', ' ', ' ,', $user->description ); if ($dfs < $checkSize) $files = array('compress'=>'zip', 'codepage'=>'CP866'); else $files = array('compress'=>array('maxSize'=>$maxSize)); $files['attributeCodes'] = 'crs_management_outgoing_document'; $options = array( 'from'=>$user, 'to'=>$to, 'subj'=>$objref->description.' '.$objref->attributeref('crs_management_outgoing_subj')->value, 'body'=>implode('',$body), 'objects'=>$objref, 'files'=>$files ); if (!empty($cc)) $options['cc'] = $cc; $options['bcc'] = $user; sendEmail($options); $rcvs = array(); foreach ($to as $e=>$d) $rcvs[] = corganization()->object($d)->viewLink().' ('.$e.')'; if (isset($cc)) foreach ($cc as $e=>$d) $rcvs[] = corganization()->object($d)->viewLink().' ('.$e.')'; $msg = ' : '.implode(',', $rcvs).' : '.$dfs; } function sendEmailDocumentAndAttachments(&$msg, $objref, $to, $cc, $user, $checkSize = 5120000, $maxSize = '4500k', $extra_msg = '') { $dfs = $objref->attributeref('crs_management_outgoing_document')->filesSize; $afs = $objref->attributeref('crs_management_outgoing_attachments')->filesSize; $body = array( ' !', ' ', ' .', easla.com ' '.$objref->description.($afs > 0 ? ' ' : '').'.', $extra_msg, ', @sngp.ru', ' ', ' ,', $user->description ); if ($dfs +$afs < $checkSize) $files = array('compress'=>'zip', 'codepage'=>'CP866'); else $files = array('compress'=>array('maxSize'=>$maxSize)); $options = array( 'from'=>$user, 'to'=>$to, 'subj'=>$objref->description.' '.$objref->attributeref('crs_management_outgoing_subj')->value, 'body'=>implode('',$body), 'objects'=>$objref, 'files'=>$files ); if (!empty($cc)) $options['cc'] = $cc; $options['bcc'] = $user; sendEmail($options); $rcvs = array(); foreach ($to as $e=>$d) $rcvs[] = corganization()->object($d)->viewLink().' ('.$e.')'; if (isset($cc)) foreach ($cc as $e=>$d) $rcvs[] = corganization()->object($d)->viewLink().' ('.$e.')'; $msg = ' : '.implode(',', $rcvs).' : '.($dfs+$afs); } function sendShareDocumentAndAttachments(&$msg, $objref, $to, $cc, $user, $extra_msg = '') { $odt = date_create(); $cdt = date_add(date_create(), new DateInterval('P14D')); $share = shareFiles( cobjectref(), array('crs_management_outgoing_document','crs_management_outgoing_attachments'), $odt, $cdt, $user, 'CP866' ); $body = array( ' !', ' ', ' .', easla.com ' '.$share->link().'.', $extra_msg, ', @sngp.ru', ' ', ' ,', $user->description ); $options = array( 'from'=>$user, 'to'=>$to, 'subj'=>$objref->description.' '.$objref->attributeref('crs_management_outgoing_subj')->value, 'body'=>implode('',$body), ); if (!empty($cc)) $options['cc'] = $cc; $options['bcc'] = $user; sendEmail($options); $rcvs = array(); foreach ($to as $e=>$d) $rcvs[] = corganization()->object($d)->viewLink().' ('.$e.')'; if (isset($cc)) foreach ($cc as $e=>$d) $rcvs[] = corganization()->object($d)->viewLink().' ('.$e.')'; $msg = ' '.$share->link().' : '.implode(',', $rcvs); } function shareAttachments(&$msg, $objref, $user) { $odt = date_create(); $cdt = date_add(date_create(), new DateInterval('P14D')); $share = shareFiles( cobjectref(), array('crs_management_outgoing_attachments'), $odt, $cdt, $user, 'CP866' ); $msg = ' '.$share->link(); } function sendAsIsDocumentAndAttachments(&$msg, $objref, $to, $cc, $user, $maxSize = '4500k', $extra_msg = '') { $dfs = $objref->attributeref('crs_management_outgoing_document')->filesSize; $afs = $objref->attributeref('crs_management_outgoing_attachments')->filesSize; $body = array( ' !', ' ', ' .', easla.com ' '.$objref->description.($afs > 0 ? ' ' : '').' '. $maxSize.'.', $extra_msg, ', @sngp.ru', ' ', ' ,', $user->description ); $options = array( 'from'=>$user, 'to'=>$to, 'subj'=>$objref->description.' '.$objref->attributeref('crs_management_outgoing_subj')->value, 'body'=>implode('',$body), 'objects'=>$objref, 'files'=>array('maxSize'=>$maxSize) ); if (!empty($cc)) $options['cc'] = $cc; $options['bcc'] = $user; sendEmail($options); $rcvs = array(); foreach ($to as $e=>$d) $rcvs[] = corganization()->object($d)->viewLink().' ('.$e.')'; if (isset($cc)) foreach ($cc as $e=>$d) $rcvs[] = corganization()->object($d)->viewLink().' ('.$e.')'; $msg = ' : '.implode(',', $rcvs).' : '.($dfs+$afs); } function sendFtpSngpRuAttachments(&$msg, $objref, $to, $cc, $user, $login, $password) { $ftp_addr = 'ftp.sngp.ru'; $ftp_link = ''; $dfs = $objref->attributeref('crs_management_outgoing_document')->filesSize; $afs = $objref->attributeref('crs_management_outgoing_attachments')->filesSize; if (cobjectref()->attributeref('crs_management_outgoing_attachments')->filesCount > 0) { $ftp = ftp_ssl_connect($ftp_addr); if ($ftp == FALSE) throw new Exception(' FTPS '.$ftp_addr.'!'); ftp_login($ftp,$login,$password); ftp_pasv($ftp, true); $dir = "files"; if (!@ftp_chdir($ftp, $dir)) { ftp_mkdir($ftp, $dir); ftp_chdir($ftp, $dir); } $zip = normalizeFilename($objref->description).' - .zip'; $objref->attributeref('crs_management_outgoing_attachments')->ftp_put($ftp, $zip, FTP_BINARY); ftp_close($ftp); $ftp_link = ''; '.$zip.' } $files = array( 'attributeCodes'=>'crs_management_outgoing_document', 'compress'=>'zip', 'codepage'=>'CP866' ); $body = array( ' !', ' ', ' .', easla.com ' '.$objref->description.' '.formatSize($dfs).'.', ($ftp_link == '' ? '' : ' FTPS ftps://'.$ftp_addr.' [: '.$login.'] '.$ftp_link.'.'), ', @sngp.ru', ' ', ' ,', $user->description ); $options = array( 'from'=>$user, 'to'=>$to, 'subj'=>$objref->description.' '.$objref->attributeref('crs_management_outgoing_subj')->value, 'body'=>implode('',$body), 'objects'=>$objref, 'files'=>$files ); if (!empty($cc)) $options['cc'] = $cc; $options['bcc'] = $user; sendEmail($options); $rcvs = array(); foreach ($to as $e=>$d) $rcvs[] = corganization()->object($d)->viewLink().' ('.$e.')'; if (isset($cc)) foreach ($cc as $e=>$d) $rcvs[] = corganization()->object($d)->viewLink().' ('.$e.')'; $msg = ' : '.implode(',', $rcvs).' : '.($dfs).' '.$ftp_addr.' [: '.$login.'].'; } if (empty(cobjectref()->attributeref('crs_management_outgoing_contragent')->value)) throw new Exception(' () '.cobjectref()->viewLink()); if (empty(cobjectref()->attributeref('crs_management_outgoing_contact')->value)) throw new Exception(' () '.cobjectref()->viewLink());
sendMail. , ,
zip ,
7zip .
. :

圹å²
. , , , .. .

ããããªã
. ! , , , - !
. , .
easla.com , !
PS . « »
. , .