$translator->setSelectedLanguage($save_language); unset($save_language); $url = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?cid='.$environment->getCurrentContextID().'&mod=material&fct=detail&iid='.$item->getItemID(); $mail_body .= "\n\n"; $mail_body .= $url; $mail_obj->setSubject($mail_subject); $mail_obj->setContent($mail_body); $history = $session->getValue('history'); if ($history[0]['function'] == 'detail') { $back_hop = 1; } else { $back_hop = 0; } $mail_obj->setBackLink( $environment->getCurrentContextID(), $history[$back_hop]['module'], $history[$back_hop]['function'], ''); } if ( isset($_GET['automail']) ) { if ( $_GET['automail'] == 'true' ) { $mail_obj->setSendMailAuto(true); } } $mail_obj->toSession(); // TASK // open task can be closed $task_manager = $environment->getTaskManager(); $task_list = $task_manager->getTaskListForItem($item); if ($task_list->getCount() > 0) {
$mail_body .= LF.LF; $mail_body .= $translator->getEmailMessage('MAIL_BODY_CIAO',$current_user->getFullname(),$context_item->getTitle()); $translator->setSelectedLanguage($save_language); unset($save_language); $url = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?cid='.$environment->getCurrentContextID().'&mod=material&fct=detail&iid='.$item->getItemID(); $mail_body .= "\n\n"; $mail_body .= $url; $mail_obj->setSubject($mail_subject); $mail_obj->setContent($mail_body); $history = $session->getValue('history'); if ($history[0]['function'] == 'detail') { if (isset($history[1]) and $history[1]['function'] != 'process') { $mail_obj->setBackLink( $environment->getCurrentContextID(), $history[1]['module'], $history[1]['function'], $history[1]['parameter']); } else { $mail_obj->setBackLink( $environment->getCurrentContextID(), 'material_admin', 'index', ''); } } else { $mail_obj->setBackLink( $environment->getCurrentContextID(), $history[0]['module'], $history[0]['function'], $history[0]['parameter']); } if ( isset($_GET['automail']) ) {
$mail_body .= $translator->getEmailMessage('MAIL_BODY_CIAO',$current_user->getFullname(),$context_item->getTitle()); $url = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?cid='.$environment->getCurrentContextID(); $mail_body .= LF.LF.$url; $mail_obj->setMailFormHints($translator->getMessage('USER_MAIL_ADMIN_DESC')); $mail_obj->setSubject($mail_subject); $mail_obj->setContent($mail_body); $sender[$current_user->getFullName()] = $current_user->getEMail(); $mail_obj->setSender($sender); $receiver[$user->getFullName()] = $user->getEMail(); $mail_obj->addReceivers($receiver); $params = array(); $params['iid'] = $iid; $mail_obj->setBackLink($environment->getCurrentContextID(), 'account', 'detail', $params); unset($params); $mail_obj->toSession(); redirect($environment->getCurrentContextID(),'mail','process',''); } else { $error_string .= $translator->getMessage('COMMON_ERROR_DATABASE').$error_number.'<br />'; } } } } $class_params = array(); $class_params['environment'] = $environment; $class_params['with_modifying_actions'] = true; $form_view = $class_factory->getClass(FORM_VIEW,$class_params);
while ( ( !empty($history[$back_hop]['function']) and $history[$back_hop]['function'] == 'status' ) or ( !empty($history[$back_hop]['module']) and $history[$back_hop]['module'] == 'mail' ) ) { $back_hop++; } if ( !empty($history[$back_hop]['context']) and !empty($history[$back_hop]['module']) and !empty($history[$back_hop]['function']) and !empty($history[$back_hop]['parameter']) ) { $mail_obj->setBackLink($history[$back_hop]['context'], $history[$back_hop]['module'], $history[$back_hop]['function'], $history[$back_hop]['parameter']); } else { $mail_obj->setBackLink($environment->getCurrentContextID(), 'account', 'index', array()); } $mail_obj->toSession(); redirect($environment->getCurrentContextID(),'mail','process',''); } else { $params = array(); $params['environment'] = $environment; $params['with_modifying_actions'] = true; $form_view = $class_factory->getClass(CONFIGURATION_FORM_VIEW,$params); unset($params);