예제 #1
1
파일: view.edit.php 프로젝트: anmoldeep/erp
 function display()
 {
     require_once 'modules/ACLRoles/ACLRole.php';
     //Get the current user's role
     $objACLRole = new ACLRole();
     $roles = $objACLRole->getUserRoles($GLOBALS['current_user']->id);
     //check if they are in the Admin or Admin Manager's role
     if (in_array('Admin', $roles) || in_array('Branch Manager - Delhi', $roles)) {
         $this->ev->ss->assign('ReadOnly', '');
     } else {
         //If not pass in a variable with the value readonly
         $this->ev->ss->assign('ReadOnly', 'readonly');
     }
     //Call the parent display function
     parent::display();
 }
예제 #2
0
    function display()
    {
        global $app_list_strings;
        $json = getJSONobj();
        $prob_array = $json->encode($app_list_strings['sales_probability_dom']);
        $prePopProb = '';
        if (empty($this->bean->id) && empty($_REQUEST['probability'])) {
            $prePopProb = 'document.getElementsByName(\'sales_stage\')[0].onchange();';
        }
        $probability_script = <<<EOQ
\t<script>
\tprob_array = {$prob_array};
\tdocument.getElementsByName('sales_stage')[0].onchange = function() {
\t\t\tif(typeof(document.getElementsByName('sales_stage')[0].value) != "undefined" && prob_array[document.getElementsByName('sales_stage')[0].value]
\t\t\t&& typeof(document.getElementsByName('probability')[0]) != "undefined"
\t\t\t) {
\t\t\t\tdocument.getElementsByName('probability')[0].value = prob_array[document.getElementsByName('sales_stage')[0].value];
\t\t\t\tSUGAR.util.callOnChangeListers(document.getElementsByName('probability')[0]);

\t\t\t} 
\t\t};
\t{$prePopProb}
\t</script>
EOQ;
        $this->ss->assign('PROBABILITY_SCRIPT', $probability_script);
        parent::display();
    }
예제 #3
0
 public function display()
 {
     global $mod_strings;
     if ($_REQUEST['return_module'] == 'Project') {
         $project = new Project();
         $project->retrieve($_REQUEST['return_id']);
         //Get project resources (users & contacts)
         $resources1 = $project->get_linked_beans('project_users_1', 'User');
         $resources2 = $project->get_linked_beans('project_contacts_1', 'Contact');
         //sort into descending order
         ksort($resources1);
         ksort($resources2);
         echo "<script type='text/javascript'>";
         echo "var users = [];";
         echo "var contacts = [];";
         foreach ($resources1 as $user) {
             echo "var user = ['" . $user->id . "', '" . $user->name . "', 'User'];";
             echo "users.push(user);";
         }
         foreach ($resources2 as $contact) {
             echo "var user = ['" . $contact->id . "', '" . $contact->name . "', 'Contact'];";
             echo "contacts.push(user);";
         }
         echo "</script>";
     }
     parent::display();
 }
 function display()
 {
     if (is_admin($GLOBALS['current_user'])) {
         $this->ss->assign('EDIT_REPORTS_TO', true);
     }
     parent::display();
 }
예제 #5
0
 public function display()
 {
     // Disable VCR Control
     $this->ev->showVCRControl = false;
     // Default Team as Global
     if (empty($this->bean->id) && !$this->ev->isDuplicate) {
         $this->bean->team_id = 1;
         $this->bean->team_set_id = 1;
     }
     // Load TinyMCE
     require_once 'include/SugarTinyMCE.php';
     $tiny = new SugarTinyMCE();
     $tiny->defaultConfig['apply_source_formatting'] = true;
     $tiny->defaultConfig['cleanup_on_startup'] = true;
     $tiny->defaultConfig['relative_urls'] = false;
     $tiny->defaultConfig['convert_urls'] = false;
     $ed = $tiny->getInstance('body_html');
     $this->ss->assign('tiny_script', $ed);
     // Load Fields for main module
     if (empty($this->bean->base_module)) {
         $modulesList = PdfManagerHelper::getAvailableModules();
         $this->bean->base_module = key($modulesList);
     }
     $fieldsForSelectedModule = PdfManagerHelper::getFields($this->bean->base_module, true);
     $this->ss->assign('fieldsForSelectedModule', $fieldsForSelectedModule);
     parent::display();
 }
예제 #6
0
 function display()
 {
     $this->displayJSInclude();
     $this->setFields();
     parent::display();
     $this->displayJS();
 }
예제 #7
0
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     global $json;
     $json = getJSONobj();
     $json_config = new json_config();
     if (isset($this->bean->json_id) && !empty($this->bean->json_id)) {
         $javascript = $json_config->get_static_json_server(false, true, 'Calls', $this->bean->json_id);
     } else {
         $this->bean->json_id = $this->bean->id;
         $javascript = $json_config->get_static_json_server(false, true, 'Calls', $this->bean->id);
     }
     $this->ss->assign('JSON_CONFIG_JAVASCRIPT', $javascript);
     if ($this->ev->isDuplicate) {
         $this->bean->status = $this->bean->getDefaultStatus();
     }
     //if
     $this->ss->assign('APPLIST', $GLOBALS['app_list_strings']);
     $repeatIntervals = array();
     for ($i = 1; $i <= self::MAX_REPEAT_INTERVAL; $i++) {
         $repeatIntervals[$i] = $i;
     }
     $this->ss->assign("repeat_intervals", $repeatIntervals);
     $fdow = $GLOBALS['current_user']->get_first_day_of_week();
     $dow = array();
     for ($i = $fdow; $i < $fdow + 7; $i++) {
         $dayIndex = $i % 7;
         $dow[] = array("index" => $dayIndex, "label" => $GLOBALS['app_list_strings']['dom_cal_day_short'][$dayIndex + 1]);
     }
     $this->ss->assign('dow', $dow);
     $this->ss->assign('repeatData', json_encode($this->view_object_map['repeatData']));
     parent::display();
 }
예제 #8
0
 function display()
 {
     $this->bean->is_template = 1;
     $this->ev->ss->assign("is_template", 1);
     $this->ev->setModuleTitleKey('LBL_PROJECT_TEMPLATE');
     parent::display();
 }
예제 #9
0
    function display()
    {
        parent::display();
        ?>
        <script>
            function update_parent_display(){
                var name_elem = document.getElementById("parent_category_name");
                var id_elem = document.getElementById("parent_category_id");
                var btn_elem = document.getElementById("btn_parent_category_name");
                var disable = document.getElementById("is_parent") && document.getElementById("is_parent").checked;
                if(name_elem){
                    name_elem.disabled = disable;
                }
                if(id_elem){
                    id_elem.disabled = disable;
                }
                if(btn_elem){
                    btn_elem.disabled = disable;
                }
                if(disable){
                    SUGAR.clearRelateField(this.form, 'parent_category_name', 'parent_category_id');
                }
            }
            document.getElementById("is_parent").onchange = update_parent_display;
            document.getElementById("is_parent").onchange();
        </script>

        <?php 
    }
예제 #10
0
 function display()
 {
     require_once "custom/include/metrix/loadDynamicLists.php";
     //helper class to autopoluate the dropdowns
     require_once 'include/utils.php';
     global $current_user, $app_list_strings;
     /********************************************************************************************************/
     /*                                                   dynamic dd                                         */
     /********************************************************************************************************/
     $list = new loadDynamicLists();
     $domaine_c = $this->bean->domaine_c;
     $domaine_c = str_replace('^', '', $domaine_c);
     $selected = explode(',', $domaine_c);
     $dynamic_dd_fileds = array("pays_text_c" => array("tblname" => "ref_pays", "listname" => "pays_text_list", "field" => "nom"), "pays_iso2_c" => array("tblname" => "ref_pays", "listname" => "pays_iso2_c_list", "field" => "code"), "id_region_a_c" => array("tblname" => "ref_region", "listname" => "id_region_a_c_list", "field" => "nom"));
     ////special multi enum
     $dynamic_dd_fileds2 = array("domaine_c" => array("tblname" => "ref_discip", "listname" => "domaines_section_c_list", "field" => "Domaine", "field2" => "Discipline"));
     foreach ($dynamic_dd_fileds2 as $k => $v) {
         unset($app_list_strings[$v['listname']]);
         $edit_enum = $list->populate_list2($v['tblname'], $v['field'], $v['field2'], $selected);
     }
     foreach ($dynamic_dd_fileds as $k => $v) {
         unset($app_list_strings[$v['listname']]);
         $app_list_strings[$v['listname']] = $list->populate_list($v['tblname'], $v['field'], $v['pay']);
     }
     /********************************************************************************************************/
     /*                                                   Javascript                                         */
     /********************************************************************************************************/
     //echo $edit_enum['list_edit'];
     //if the orginisme is type_etablissement_c==faculte
     echo "\r\n\r\n\t\t\t<script>\r\n\t\t\t\t\r\n\t\t\t\t\$(document).ready(function()\r\n\t\t\t\t{     render();//init\r\n\t\t\t\t\t\$('#domaine_c').html('" . $edit_enum['list_edit'] . "');\r\n\r\n\t\t\t\t\t\$( '#type_etablissement_c' ).change(function() {                \r\n                      \r\n                      render();\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t  });\t\r\n\t\t\t\t});\r\n\r\n            //custom function\r\n            render = function(){\r\n\r\n            \tvar remove_fields =    \t['coda_name_c','coda_sname_c','prive_c','id_etat_c','date_effectif_c','date_maj_c','statut_c','commentaire2_c','code_hier_c','qualite_c','adhesion_c','sigle_c','historique','nb_etud_c','nb_ens_c','nb_cherch_c','rub_c','commentaire2_c','nb_etud_annee_obs_c','nb_ens_annee_obs_c','nb_cherch_annee_obs_c','chiffres_c'];//you can add the fields you want to hide here\r\n                       \r\n\r\n\t\t\t\t\t\t\$.each( remove_fields, function( key, value ) {\r\n                        var dd_val =\$( '#type_etablissement_c' ).val();\r\n\t\t                if(dd_val=='faculte'){\r\n\t\t                \t\$('#' + value ).hide();\r\n\t\t                \t\$('#' + value +'_label' ).css( 'color','white' );\r\n\t\t                \t\$('#date_effectif_c_date').parent().parent().hide();\r\n\t\t                \t\$('#date_maj_c_date').parent().parent().hide();\r\n\t\t                \t\$('#adhesion_c_date').parent().parent().hide();\r\n\t\t                \t\r\n\t\t                \t\r\n\t\t                \t\r\n\t\t                }\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\$('#' + value  ).show();\r\n\t\t\t\t\t\t\t\$('#' + value +'_label' ).show();\r\n\t\t\t\t\t\t\t\$('#' + value +'_label' ).css( 'color','black' );\r\n\t\t\t\t\t\t\t\$('#date_effectif_c_date').parent().parent().show();\r\n\t\t                \t\$('#date_maj_c_date').parent().parent().show();\r\n\t\t                \t\$('#adhesion_c_date').parent().parent().show();\r\n\t\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t\t});\r\n            }\r\n\r\n\t\t\t</script>";
     $this->ev->process();
     parent::display();
 }
예제 #11
0
 public function display()
 {
     global $current_user, $current_language, $sugar_flavor, $sugar_config;
     if (!$current_user->is_admin) {
         sugar_die(translate("LBL_MUST_BE_ADMIN"));
     }
     //RemoveTabSave: let dashboard pass since we are still altering it
     if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'RemoveTabSave') {
         if (isset($_REQUEST['TabToRemove'])) {
             $dashboardManager = BeanFactory::newBean("dash_DashboardManager");
             $dashboardManager->temp_unencoded_pages = $dashboardManager->deletePageByKey($_REQUEST['TabToRemove'], $current_user->getPreference('pages', 'Home'));
             $dashboardManager->temp_unencoded_dashlets = $current_user->getPreference('dashlets', 'Home');
             $dashboardManager->setDashboardForUser($current_user);
             $current_user->getPreference('pages', 'Home');
             $current_user->getPreference('dashlets', 'Home');
         }
     } elseif (isset($this->bean->fetched_row['id'])) {
         //set this dashboard for current user
         $this->bean->setDashboardForUser($current_user);
     } else {
         //set dashboard back to clean template
         $current_user->resetPreferences('Home');
     }
     parent::display();
     //get language for dashboard
     $mod_strings = return_module_language($current_language, 'Home');
     //render dashboard
     $lock_homepage = $sugar_config['lock_homepage'];
     $sugar_config['lock_homepage'] = false;
     require_once "modules/Home/index.php";
     $sugar_config['lock_homepage'] = $lock_homepage;
 }
예제 #12
0
 public function display()
 {
     $GLOBALS['log']->info("JrMis_DepartmentsViewEdit.display");
     $GLOBALS['log']->debug("JrMis_DepartmentsViewEdit.display, bean_id: " . $this->bean->id);
     global $app_list_strings;
     $city_list = array();
     // if (!empty($this->bean->id))
     // {
     $this->bean->custom_fields->retrieve();
     $province_id = $this->bean->province_c;
     $max_id = $province_id + 9999;
     $GLOBALS['log']->debug("JrMis_DepartmentsViewEdit.display, privince_id: " . $province_id);
     $GLOBALS['log']->debug("JrMis_DepartmentsViewEdit.display, max_id: " . $max_id);
     foreach ($app_list_strings['jrmis_city_list'] as $id => $val) {
         if ($id > $province_id && $id <= $max_id) {
             $city_list[$id] = $val;
         }
     }
     // }
     // else
     // {
     //     $city_list[''] = '请选择省份';
     // }
     $GLOBALS['log']->debug("JrMis_DepartmentsViewEdit.display, city_list: " . print_r($city_list, TRUE));
     $this->ss->assign('CITY_LIST', $city_list);
     parent::display();
 }
예제 #13
0
    function display()
    {
        global $mod_strings;
        parent::display();
        $javascript = <<<EOQ
EOQ;
        echo $javascript;
    }
예제 #14
0
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     if ($this->ev->isDuplicate) {
         $this->bean->status = $this->bean->getDefaultStatus();
     }
     //if
     parent::display();
 }
예제 #15
0
 function display()
 {
     $admin = Administration::getSettings();
     if (isset($admin->settings['portal_on']) && $admin->settings['portal_on']) {
         $this->ev->ss->assign("PORTAL_ENABLED", true);
     }
     parent::display();
 }
예제 #16
0
 function display()
 {
     $this->bean->is_template = 0;
     if (!empty($this->ev->ss)) {
         $this->ev->ss->assign("is_template", 0);
     }
     parent::display();
 }
예제 #17
0
 function display()
 {
     $this->populateCurrency();
     $this->populateQuoteTemplates();
     $this->populateLineItems();
     parent::display();
     $this->displayJS();
 }
예제 #18
0
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     if ($this->ev->isDuplicate) {
         $this->bean->status = $GLOBALS['mod_strings']['LBL_DEFAULT_STATUS'];
     }
     //if
     parent::display();
 }
예제 #19
0
 public function display()
 {
     global $current_user, $current_language, $sugar_flavor, $sugar_config;
     if (!$current_user->is_admin) {
         sugar_die(translate("LBL_MUST_BE_ADMIN"));
     }
     parent::display();
 }
예제 #20
0
 function display()
 {
     $this->fix_fields_request();
     parent::display();
     // Return realty email
     if ($_REQUEST['em_dup'] == 1) {
         echo "<script type='text/javascript'>\n                function em_dup()\n                {\n                    \$('#Realty0emailAddress0').val('{$_REQUEST['Realty0emailAddress0']}')\n                }\n                setTimeout(em_dup,10)\n            </script>";
     }
 }
예제 #21
0
 function display()
 {
     if (isset($this->bean->id)) {
         $this->ss->assign("FILE_OR_HIDDEN", "hidden");
         if (empty($_REQUEST['isDuplicate']) || $_REQUEST['isDuplicate'] == 'false') {
             $this->ss->assign("DISABLED", "disabled");
         }
     } else {
         $this->ss->assign("FILE_OR_HIDDEN", "file");
     }
     parent::display();
 }
예제 #22
0
 public function testdisplay()
 {
     //execute the method with essential parameters set. it should return some html.
     $view = new ViewEdit();
     $view->module = 'Users';
     $view->bean = new User();
     $view->preDisplay();
     $view->ev->ss = new Sugar_Smarty();
     ob_start();
     $view->display();
     $renderedContent = ob_get_contents();
     ob_end_clean();
     $this->assertGreaterThan(0, strlen($renderedContent));
 }
예제 #23
0
 function display()
 {
     if (is_admin($GLOBALS['current_user'])) {
         $json = getJSONobj();
         require_once 'include/QuickSearchDefaults.php';
         $qsd = new QuickSearchDefaults();
         $sqs_objects = array('EditView_reports_to_name' => $qsd->getQSUser());
         $sqs_objects['EditView_reports_to_name']['populate_list'] = array('reports_to_name', 'reports_to_id');
         $quicksearch_js = '<script type="text/javascript" language="javascript">sqs_objects = ' . $json->encode($sqs_objects) . '; enableQS();</script>';
         $this->ss->assign('REPORTS_TO_JS', $quicksearch_js);
         $this->ss->assign('EDIT_REPORTS_TO', true);
     }
     parent::display();
 }
예제 #24
0
 function display()
 {
     global $mod_strings, $app_strings, $app_list_strings, $sugar_config, $beanFiles;
     $this->ss->assign("MOD", $mod_strings);
     $this->ss->assign("APP_LIST", $app_list_strings);
     // Init default name
     $this->bean->name = '[TILK] ';
     // IF THE TILK IS CREATED FROM AN CONTACT
     if (isset($_REQUEST['CreateFromContact']) && $_REQUEST['CreateFromContact'] == 'true') {
         // CREATE DEFAULT TILK LINK WITH CONTACT
         require_once $beanFiles['Contact'];
         $link_contact = new Contact();
         $link_contact->retrieve($_REQUEST['return_id']);
         $this->bean->contacts_id = $link_contact->id;
         $this->bean->contacts_name = $link_contact->name;
         $this->bean->contact_email = $link_contact->emailAddress->getPrimaryAddress($link_contact);
         $this->bean->name = '[TILK] ' . $link_contact->name;
         //$this->bean->id     = $this->bean->save();
         $_REQUEST['record'] = $this->bean->id;
         // TILKEE API - CREATE PROJECT AND SYNCH IT
     }
     // IF THE TILK IS CREATED FROM AN LEAD
     if (isset($_REQUEST['CreateFromLead']) && $_REQUEST['CreateFromLead'] == 'true') {
         // CREATE DEFAULT TILK LINK WITH LEAD
         require_once $beanFiles['Lead'];
         $link_lead = new Lead();
         $link_lead->retrieve($_REQUEST['return_id']);
         $this->bean->leads_name = $link_lead->name;
         $this->bean->leads_id = $link_lead->id;
         $this->bean->contact_email = $link_lead->emailAddress->getPrimaryAddress($link_lead);
         $this->bean->name = '[TILK] ' . $link_lead->name;
         //$this->bean->id     = $this->bean->save();
         $_REQUEST['record'] = $this->bean->id;
         // TILKEE API - CREATE PROJECT AND SYNCH IT
     }
     // IF THE TILK IS CREATED FROM AN PROJECT
     if (isset($_REQUEST['CreateFromProject']) && $_REQUEST['CreateFromProject'] == 'true') {
         // CREATE DEFAULT TILK LINK WITH PROJECT
         require_once $beanFiles['TILKEE_PROJECTS'];
         $link_tilkee_project = new TILKEE_PROJECTS();
         $link_tilkee_project->retrieve($_REQUEST['return_id']);
         $this->bean->tilkee_projects_name = $link_tilkee_project->name;
         $this->bean->tilkee_projects_id = $link_tilkee_project->id;
         //$this->bean->id     = $this->bean->save();
         $_REQUEST['record'] = $this->bean->id;
         // TILKEE API - CREATE PROJECT AND SYNCH IT
     }
     parent::display();
 }
예제 #25
0
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     global $beanFiles;
     require_once $beanFiles['ProjectTask'];
     $focus = BeanFactory::getBean('ProjectTask');
     if (isset($_REQUEST['record'])) {
         $focus->retrieve($_REQUEST['record']);
     }
     $this->ss->assign('resource', $focus->getResourceName());
     if (isset($_REQUEST['fromGrid']) && $_REQUEST['fromGrid'] == '1') {
         $this->ss->assign('project_id', $focus->project_id);
         $this->ss->assign('FROM_GRID', true);
     } else {
         $this->ss->assign('FROM_GRID', false);
     }
     parent::display();
 }
예제 #26
0
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     global $json;
     $json = getJSONobj();
     $json_config = new json_config();
     if (isset($this->bean->json_id) && !empty($this->bean->json_id)) {
         $javascript = $json_config->get_static_json_server(false, true, 'Meetings', $this->bean->json_id);
     } else {
         $this->bean->json_id = $this->bean->id;
         $javascript = $json_config->get_static_json_server(false, true, 'Meetings', $this->bean->id);
     }
     $this->ss->assign('JSON_CONFIG_JAVASCRIPT', $javascript);
     if ($this->ev->isDuplicate) {
         $this->bean->status = $GLOBALS['mod_strings']['LBL_DEFAULT_STATUS'];
     }
     //if
     parent::display();
 }
예제 #27
0
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     global $json;
     $json = getJSONobj();
     $json_config = new json_config();
     if (isset($this->bean->json_id) && !empty($this->bean->json_id)) {
         $javascript = $json_config->get_static_json_server(false, true, 'Calls', $this->bean->json_id);
     } else {
         $this->bean->json_id = $this->bean->id;
         $javascript = $json_config->get_static_json_server(false, true, 'Calls', $this->bean->id);
     }
     $this->ss->assign('JSON_CONFIG_JAVASCRIPT', $javascript);
     if ($this->ev->isDuplicate) {
         $this->bean->status = $this->bean->getDefaultStatus();
     }
     //if
     parent::display();
 }
예제 #28
0
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     global $json;
     $json = getJSONobj();
     $json_config = new json_config();
     if (isset($this->bean->json_id) && !empty($this->bean->json_id)) {
         $javascript = $json_config->get_static_json_server(false, true, 'Meetings', $this->bean->json_id);
     } else {
         $this->bean->json_id = $this->bean->id;
         $javascript = $json_config->get_static_json_server(false, true, 'Meetings', $this->bean->id);
     }
     $this->ss->assign('JSON_CONFIG_JAVASCRIPT', $javascript);
     if ($this->ev->isDuplicate) {
         $this->bean->status = $this->bean->getDefaultStatus();
     }
     //if
     parent::display();
     echo "<script> showStatus( \$('#status'), 'Meetings' );\n                          \$('#status').change(function(){\n                               showStatus( \$(this), 'Meetings' );\n                          });\n                </script>";
 }
예제 #29
0
    function display()
    {
        global $mod_strings;
        $description = $this->bean->description;
        $description = <<<EOQ
<div id='description_text_div'>
    <textarea class = 'ckeditor' id='editor1' tabindex='0' name='description' cols="100" rows="40">{$description}</textarea>
</div>
EOQ;
        $this->ev->ss->assign("CUSTOM_DISCRIPTION", $description);
        parent::display();
        require_once "include/SugarCKEditor.php";
        $ckeditor = new SugarCKEditor();
        echo $ckeditor->getInstance();
        $javascript = <<<EOQ
<script type="text/javascript" language="Javascript">
</script>
EOQ;
        echo $javascript;
    }
예제 #30
0
 function display()
 {
     parent::display();
     global $sugar_config;
     $new = empty($this->bean->id);
     if ($new) {
         ?>
         <script>
             $(document).ready(function(){
                 $('#update_text').closest('.edit-view-row-item').html('');
                 $('#update_text_label').closest('.edit-view-row-item').html('');
                 $('#internal').closest('.edit-view-row-item').html('');
                 $('#internal_label').closest('.edit-view-row-item').html('');
                 $('#addFileButton').closest('.edit-view-row-item').html('');
                 $('#case_update_form_label').closest('.edit-view-row-item').html('');
             });
         </script>
     <?php 
     }
 }