id; if(isset($_REQUEST['record'])) { $focus->retrieve($_REQUEST['record']); } $edit = new ViewEditTasks(); $edit->ss = new Sugar_Smarty(); $edit->module = 'Tasks'; $edit->bean = $focus; //$edit->tplFile = 'include/ECM/EcmViews/EditView/Tabs/EditView.tpl'; $edit->tplFile = 'include/EditView/EditView.tpl'; $focus = new Task(); //custom subpanel create button if ((isset($_REQUEST['first_parent_id'])) && (isset($_REQUEST['first_parent_type']))) { switch ($_REQUEST['first_parent_type']) { case 'Accounts': {}; case 'EcmProducts': $fields=' name '; break; case 'Contacts': $fields = ' first_name, last_name '; break; case 'EcmQuotes': $fields = ' document_no, name '; break; } $q="SELECT ".$fields." FROM ".strtolower($_REQUEST['first_parent_type'])." WHERE id='".$_REQUEST['first_parent_id']."'"; $res = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query($q)); switch ($_REQUEST['first_parent_type']) { case 'Accounts': {}; case 'EcmProducts': $name=$res['name']; break; case 'Contacts': $name=$res['first_name'].' '.$res['last_name']; break; case 'EcmQuotes': if ($res['name']!='') $name = $res['name']; else $name=$res['document_no']; break; } $focus->first_parent_type=$_REQUEST['first_parent_type']; $focus->first_parent_name=$name; $focus->first_parent_id=$_REQUEST['first_parent_id']; $edit->ss->assign("FIRST_PARENT_ID", $focus->first_parent_id); $edit->ss->assign("FIRST_PARENT_NAME", $focus->first_parent_name); } //end custom subpanel create if(isset($_REQUEST['record'])) { $focus->retrieve($_REQUEST['record']); $edit->ss->assign("FIRST_PARENT_ID", $focus->first_parent_id); $edit->ss->assign("FIRST_PARENT_NAME", $focus->first_parent_name); $edit->ss->assign("SECOND_PARENT_ID", $focus->second_parent_id); $edit->ss->assign("SECOND_PARENT_NAME", $focus->second_parent_name); $edit->ss->assign("THIRD_PARENT_ID", $focus->third_parent_id); $edit->ss->assign("THIRD_PARENT_NAME", $focus->third_parent_name); echo ''; } else { echo ''; } //fields for first, second and thirs parent //add mz 2012-05-14 $pto = ''; //second parent type options foreach ($app_list_strings['parent_type_display'] as $k=>$v){ $pto.=''; } $edit->ss->assign("FIRST_PARENT_TYPE_OPTIONS",$pto); $pto = ''; //second parent type options foreach ($app_list_strings['parent_type_display'] as $k=>$v){ $pto.=''; } $edit->ss->assign("SECOND_PARENT_TYPE_OPTIONS",$pto); $pto = ''; //third parent type options foreach ($app_list_strings['parent_type_display'] as $k=>$v){ $pto.=''; } $edit->ss->assign("THIRD_PARENT_TYPE_OPTIONS",$pto); $edit->preDisplay(); echo $edit->display(); //echo '
'; //require_once('subpanels.php'); //echo '
'; ?>