if ($isactive == 1 || $isactive == "on") { $o->isactive = 1; } else { $o->isactive = 0; } switch ($action) { case "create": // if the token is exist and not yet expired $log->showLog(4, "Accessing create record event, with region name={$o->region_name}"); if ($s->check(true, $token, "CREATE_STD")) { if ($o->insertRegion()) { $latest_id = $o->getLatestRegionID(); redirect_header("region.php", $pausetime, "Your data is saved, redirect to create more record."); } else { $log->showLog(1, "Warning, '{$o->region_name}' cannot be save, please make sure your data is correct"); $token = $s->createToken($tokenlife, "CREATE_STD"); $o->countryctrl = $ctrl->getSelectCountry($o->country_id, 'N'); $o->orgctrl = $ctrl->selectionOrg($o->createdby, $defaultorganization_id, 'N', "", 'Y'); $o->getInputForm("new", -1, $token); $o->showRegionTable(); } } else { // if the token is not valid or the token is expired, it back to previous form with previous inputed data $log->showLog(1, "Warning, '{$o->region_name}' cannot be save due to token expired"); $token = $s->createToken($tokenlife, "CREATE_STD"); $o->countryctrl = $ctrl->getSelectCountry($o->country_id, 'N'); $o->orgctrl = $ctrl->selectionOrg($o->createdby, $defaultorganization_id, 'N', "", 'Y'); $o->getInputForm("new", -1, $token); $o->showRegionTable(); } break;
$log->showLog(4, "Accessing create record event, with debitcreditnote name={$o->debitcreditnote_no}"); if ($s->check(true, $token, "CREATE_NOTE")) { if ($o->insertDebitCreditNote()) { $latest_id = $o->getLatestDebitCreditNoteID(); if ($pl->createDebitCreditNoteLine($latest_id, $o->adddebitcreditnotelineqty, $o->defaultspecies_id, $o->defaultwoodtype)) { if ($chkAddNew == 'on') { redirect_header("debitcreditnote.php", $pausetime, "Your data is saved"); } else { redirect_header("debitcreditnote.php?action=edit&debitcreditnote_id={$latest_id}", $pausetime, "Your data is saved"); } } else { redirect_header("debitcreditnote.php?action=edit&debitcreditnote_id={$latest_id}", $pausetime, "Record header is saved, but some problem exist on creating debitcreditnote child, please create child record manually after form refresh."); } } else { echo "<b style='color:red'>Record cannot save, please reverified data you insert into this record.</b>"; $token = $s->createToken($tokenlife, "CREATE_NOTE"); $o->orgctrl = $ctrl->selectionOrg($o->createdby, $o->organization_id, 'N', "", 'Y'); include_once "class/Accounts.php"; $acc = new Accounts(); $acc->fetchAccounts($o->bpartneraccounts_id); if ($acc->account_type == 2) { $o->bpartnerctrl = $ctrl->getSelectBPartner($o->bpartner_id, 'Y', "onchange='changeBPartner(this.value)'", "bpartner_id2", "and (debtoraccounts_id={$o->bpartneraccounts_id} and isdebtor=1)", "N", "bpartner_id2"); } elseif ($acc->account_type == 3) { $o->bpartnerctrl = $ctrl->getSelectBPartner($o->bpartner_id, 'Y', "onchange='changeBPartner(this.value)'", "bpartner_id2", "and (creditoraccounts_id={$o->bpartneraccounts_id} and iscreditor=1)", "N", "bpartner_id2"); } $o->accountsctrl = $ctrl->getSelectAccounts($o->accounts_id, 'Y', "", "accounts_id", "and (account_type<>2 AND account_type<>3)"); $o->bpartneraccountsctrl = $ctrl->getSelectAccounts($o->bpartneraccounts_id, 'Y', "onchange='reloadBPartnerAccount(this.value)'", "bpartneraccounts_id", "and ( account_type=2 or account_type=3)"); $o->currencyctrl = $ctrl->getSelectCurrency($o->currency_id, 'N', 'currency_id', "", "onchange='refreshUnitPrice(this.value)'"); $o->getInputForm("new", -1, $token); $o->showDebitCreditNoteTable("WHERE debitcreditnote_id>0 and organization_id={$defaultorganization_id}", "ORDER BY debitcreditnote_no"); }
$o->isactive = 1; } else { $o->isactive = 0; } switch ($action) { //When user submit new organization case "create": // if the token is exist and not yet expired if ($s->check(false, $token, "CREATE_ORG")) { //if organization saved if ($o->insertOrganization()) { $latest_id = $o->getLatestOrganizationID(); redirect_header("organization.php?action=edit&organization_id={$latest_id}", $pausetime, "Your data is saved."); } else { $o->groupctrl = $ctrl->getAllSystemGroup(0); $token = $s->createToken($tokenlife, "CREATE_ORG"); if ($o->country_id == "") { $o->country_id = 0; } if ($o->currency_id == "") { $o->currency_id = 0; } $o->countryctrl = $ctrl->getSelectCountry($o->country_id, 'N'); $o->currencyctrl = $ctrl->getSelectCurrency($o->currency_id, 'N'); $o->getInputForm("new", -1, $token); $o->showOrganizationTable("where organization_id>0", "order by defaultlevel,organization_name"); } } else { // if the token is not valid or the token is expired, it back to previous form with previous inputed data $o->groupctrl = $ctrl->getAllSystemGroup(0); $token = $s->createToken($tokenlife, "CREATE_ORG");
$modversion['config'][5]['name'] = 'imgsnumber'; $modversion['config'][5]['title'] = '_MI_RMC_IMGSNUMBER'; $modversion['config'][5]['description'] = ''; $modversion['config'][5]['formtype'] = 'textbox'; $modversion['config'][5]['valuetype'] = 'int'; $modversion['config'][5]['default'] = 20; // Secure Key $modversion['config'][6]['name'] = 'secretkey'; $modversion['config'][6]['title'] = '_MI_RMC_SECREY'; $modversion['config'][6]['description'] = '_MI_RMC_SECREYD'; $modversion['config'][6]['formtype'] = 'textbox'; $modversion['config'][6]['valuetype'] = 'text'; if (!isset($xoopsSecurity)) { $xoopsSecurity = new XoopsSecurity(); } $modversion['config'][6]['default'] = $xoopsSecurity->createToken(); // Formato HTML5 $modversion['config'][7]['name'] = 'dohtml'; $modversion['config'][7]['title'] = '_MI_RMC_DOHTML'; $modversion['config'][7]['description'] = ''; $modversion['config'][7]['formtype'] = 'yesno'; $modversion['config'][7]['valuetype'] = 'int'; $modversion['config'][7]['default'] = 1; $modversion['config'][8]['name'] = 'dosmileys'; $modversion['config'][8]['title'] = '_MI_RMC_DOSMILE'; $modversion['config'][8]['description'] = ''; $modversion['config'][8]['formtype'] = 'yesno'; $modversion['config'][8]['valuetype'] = 'int'; $modversion['config'][8]['default'] = 1; $modversion['config'][9]['name'] = 'doxcode'; $modversion['config'][9]['title'] = '_MI_RMC_DOXCODE';
if ($isactive == "Y" or $isactive == "on") { $o->isactive = 'Y'; } else { $o->isactive = 'N'; } switch ($action) { //When user submit new organization case "create": // if the token is exist and not yet expired $log->showLog(4, "Accessing create record event, with window name={$o->window_name}"); if ($s->check(false, $token, "CREATE_WDW")) { if ($o->insertWindow()) { $latest_id = $o->getLatestWindowID(); redirect_header("window.php?action=edit&window_id={$latest_id}", $pausetime, "Your data is saved, the new id={$latest_id}"); } else { $token = $s->createToken($tokenlife, "CREATE_WDW"); $o->getInputForm("new", -1, $token); $o->showWindowTable(); } } else { // if the token is not valid or the token is expired, it back to previous form with previous inputed data $token = $s->createToken($tokenlife, "CREATE_WDW"); $o->getInputForm("new", -1, $token); $o->showWindowTable(); } break; //when user request to edit particular organization //when user request to edit particular organization case "edit": if ($o->fetchWindow($o->window_id)) { //create a new token for editing a form
if ($isactive == 1 or $isactive == "on") { $o->isactive = 1; } else { $o->isactive = 0; } switch ($action) { //When user submit new organization case "create": // if the token is exist and not yet expired $log->showLog(4, "Accessing create record event, with country name={$o->country_name}"); if ($s->check(false, $token, "CREATE_WDW")) { if ($o->insertCountry()) { $latest_id = $o->getLatestCountryID(); redirect_header("country.php?action=edit&country_id={$latest_id}", $pausetime, "Your data is saved, the new id={$latest_id}"); } else { $token = $s->createToken(120, "CREATE_WDW"); $o->getInputForm("new", -1, $token); $o->showCountryTable("WHERE country_id>0", "ORDER BY defaultlevel,country_name"); } } else { // if the token is not valid or the token is expired, it back to previous form with previous inputed data $token = $s->createToken(120, "CREATE_WDW"); $o->getInputForm("new", -1, $token); $o->showCountryTable("WHERE country_id>0", "ORDER BY defaultlevel,country_name"); } break; //when user request to edit particular organization //when user request to edit particular organization case "edit": if ($o->fetchCountry($o->country_id)) { //create a new token for editing a form
$o->windowsctrl = $ctrl->getSelectWindows($o->table_name, "Y"); switch ($action) { //When user submit new organization case "create": // if the token is exist and not yet expired $log->showLog(4, "Accessing create record event, with activitysummary name={$o->activitysummary_name}"); if ($s->check(false, $token, "CREATE_STD")) { if ($o->insertActivitysummary()) { $latest_id = $o->getLatestActivitysummaryID(); redirect_header("activitysummary.php?action=edit&activitysummary_id={$latest_id}", $pausetime, "Your data is saved, the new id={$latest_id}"); } else { echo "Can't create activitysummary!"; } } else { // if the token is not valid or the token is expired, it back to previous form with previous inputed data $token = $s->createToken(120, "CREATE_STD"); $o->getInputForm("new", -1, $token); $o->showActivitysummaryTable(); } break; //when user request to edit particular organization //when user request to edit particular organization case "edit": if ($o->fetchActivitysummary($o->activitysummary_id)) { //create a new token for editing a form $token = $s->createToken(120, "CREATE_STD"); $o->getInputForm("edit", $o->activitysummary, $token); $o->showActivitysummaryTable("WHERE activitysummary_id>0", "ORDER BY functiontype,seqno,activitysummary_name"); } else { //if can't find particular organization from database, return error message redirect_header("activitysummary.php", 3, "Some error on viewing your activitysummary data, probably database corrupted");
$cu_settings['config'][] = array('name' => 'gui_disable', 'title' => __('Disable new GUI when working on non native modules?', 'rmcommon'), 'description' => '', 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 1, 'category' => 'appearance'); // Editor $cu_settings['config'][] = array('name' => 'editor_type', 'title' => __('Select the default editor', 'rmcommon'), 'description' => '', 'formtype' => 'select', 'valuetype' => 'text', 'default' => 'tiny', 'options' => array(__('Visual Editor', 'rmcommon') => 'tiny', __('HTML Editor', 'rmcommon') => 'html', __('Simple Editor', 'rmcommon') => 'simple', __('Markdown Editor', 'rmcommon') => 'markdown'), 'category' => 'general'); $cu_settings['config'][] = array('name' => 'markdown', 'title' => __('Parse MarkDown', 'rmcommon'), 'description' => __('This option enables the parsing for Markdown code for text. Must be enabled when "Markdown Editor" is selected.', 'rmcommon'), 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 1, 'category' => 'general'); // JQuery inclusion $cu_settings['config'][] = array('name' => 'jquery', 'title' => __('Enable JQuery for front end', 'rmcommon'), 'description' => __('When this option is enabled, Common Utilities will include JQuery automatically. Please, disable this option only when your theme include jquery by default.', 'rmcommon'), 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => '0', 'category' => 'general'); // Images store type $cu_settings['config'][] = array('name' => 'imagestore', 'title' => __('Arrange images by date', 'rmcommon'), 'description' => '', 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 1, 'category' => 'general'); // Images Categories list limit number $cu_settings['config'][] = array('name' => 'catsnumber', 'title' => __('Limit for image categories list.', 'rmcommon'), 'description' => '', 'formtype' => 'textbox', 'valuetype' => 'int', 'default' => 10, 'category' => 'general'); $cu_settings['config'][] = array('name' => 'imgsnumber', 'title' => __('Image manager: number of images per page', 'rmcommon'), 'description' => '', 'formtype' => 'textbox', 'valuetype' => 'int', 'default' => 20, 'category' => 'general'); // Secure Key if (!isset($xoopsSecurity)) { $xoopsSecurity = new XoopsSecurity(); } $cu_settings['config'][] = array('name' => 'secretkey', 'title' => __('Secret Key', 'rmcommon'), 'description' => __('Provide a secret key used to encrypt information.', 'rmcommon'), 'formtype' => 'textbox', 'valuetype' => 'text', 'default' => defined('RMCPATH') ? '' : $xoopsSecurity->createToken(), 'category' => 'general'); // Formato HTML5 $cu_settings['config'][] = array('name' => 'dohtml', 'title' => __('Allow HTMl in text', 'rmcommon'), 'description' => '', 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 1, 'category' => 'appearance'); $cu_settings['config'][] = array('name' => 'dosmileys', 'title' => __('Allow smilies in text', 'rmcommon'), 'description' => '', 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 1, 'category' => 'appearance'); $cu_settings['config'][] = array('name' => 'doxcode', 'title' => __('Allow XoopsCode', 'rmcommon'), 'description' => '', 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 1, 'category' => 'appearance'); $cu_settings['config'][] = array('name' => 'doimage', 'title' => __('Allow images in text', 'rmcommon'), 'description' => '', 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 0, 'category' => 'appearance'); $cu_settings['config'][] = array('name' => 'dobr', 'title' => __('Auto add line breaks in text', 'rmcommon'), 'description' => '', 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 0, 'category' => 'appearance'); $cu_settings['config'][] = array('name' => 'mods_number', 'title' => __('Modules number on dashboard', 'rmcommon'), 'description' => '', 'formtype' => 'textbox', 'valuetype' => 'int', 'default' => 6, 'category' => 'appearance'); $cu_settings['config'][] = array('name' => 'rssimage', 'title' => __('Image for RSS feeds', 'rmcommon'), 'description' => '', 'formtype' => 'textbox', 'valuetype' => 'text', 'default' => XOOPS_URL . '/modules/rmcommon/images/rssimage.png', 'category' => 'appearance'); // Comments $cu_settings['config'][] = array('name' => 'enable_comments', 'title' => __('Enable comments', 'rmcommon'), 'description' => '', 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 1, 'category' => 'comments'); $cu_settings['config'][] = array('name' => 'anonymous_comments', 'title' => __('Allow anonymous users to post comments', 'rmcommon'), 'description' => '', 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 1, 'category' => 'comments'); $cu_settings['config'][] = array('name' => 'approve_reg_coms', 'title' => __('Automatically approve comments by registered users', 'rmcommon'), 'description' => '', 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 1, 'category' => 'comments'); $cu_settings['config'][] = array('name' => 'approve_anon_coms', 'title' => __('Automatically approve comments by anonymous users', 'rmcommon'), 'description' => '', 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 0, 'category' => 'comments'); $cu_settings['config'][] = array('name' => 'allow_edit', 'title' => __('Allow users to edit their comments', 'rmcommon'), 'description' => '', 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 0, 'category' => 'comments'); $cu_settings['config'][] = array('name' => 'edit_limit', 'title' => __('Time limit to edit a comment (in hours).', 'rmcommon'), 'description' => '', 'formtype' => 'textbox', 'valuetype' => 'int', 'default' => 1, 'category' => 'comments');
$acc->updatedby=$o->updatedby; $effectedamt=$o->openingbalance-$o->previousopeningbalance; $acc->updateLastBalance($o->accounts_id,$o->openingbalance,$o->previousopeningbalance,$latest_id); $acc->updateOpenBalance($o->accounts_id,$effectedamt); $acc->updateOpeningBalanceAccount($o->openingbalance,$o->previousopeningbalance); $acc->recalculateAllParentAccounts(); // $acc->recalculateAllParentAccounts(); } */ redirect_header("bpartner.php?action=view&bpartner_id={$o->bpartner_id}", $pausetime, "Your data is saved, Create More Record."); //redirect_header("bpartner.php?action=edit&bpartner_id=$latest_id",$pausetime,"Your data is saved, the new id=$latest_id"); } else { $token = $s->createToken($tokenlife, "CREATE_BPARTNER"); $log->saveLog(0, $tablebpartner, $o->updatesql, "I", "F"); $o->orgctrl = $ctrl->selectionOrg($o->createdby, $o->organization_id, 'N', "", 'Y'); $o->bpartnergroupctrl = $ctrl->getSelectBPartnerGroup($o->bpartnergroup_id, 'Y', "onchange='getDefaultAccount(this.value)'"); $o->industryctrl = $ctrl->getSelectIndustry($o->industry_id, 'N'); $o->currencyctrl = $ctrl->getSelectCurrency($o->currency_id, 'N'); $o->termsctrl = $ctrl->getSelectTerms($o->terms_id, 'Y'); $o->taxctrl = $ctrl->getSelectTax($o->tax_id, 'Y'); if ($accountmoduleexist == true) { $o->debtoraccountsctrl = $ctrl->getSelectAccounts($o->debtoraccounts_id, 'Y', "onchange=''", "debtoraccounts_id", ""); $o->creditoraccountsctrl = $ctrl->getSelectAccounts($o->creditoraccounts_id, 'Y', "onchange=''", "creditoraccounts_id", ""); } else { $o->debtoraccountsctrl = "Accounting Module doesn't exist <input type='hidden' name='debtoraccounts_id' value=0>"; $o->creditoraccountsctrl = "Accounting Module doesn't exist <input type='hidden' name='creditoraccounts_id' value=0>"; } // $o->accountsctrl=$ctrl->getSelectAccounts($o->accounts_id,'Y',"onchange=''","accounts_id","");
$log->saveLog($latest_id, $tablecontacts, $o->updatesql, "I", "O"); redirect_header("bpartner.php?action=view&bpartner_id={$o->bpartner_id}", $pausetime, "Your data is saved, redirect to create more record."); } else { $log->saveLog(0, $tablecontacts, $o->updatesql, "I", "F"); redirect_header("bpartner.php?action=view&bpartner_id={$o->bpartner_id}", $pausetime, "Warning! Your data cannot saved, redirect to business partner"); } } else { redirect_header("bpartner.php?action=view&bpartner_id={$o->bpartner_id}", 3, "Cannot save contacts due to token expired."); } break; //when user request to edit particular organization //when user request to edit particular organization case "edit": if ($o->fetchContacts($o->contacts_id)) { //create a new token for editing a form $token = $s->createToken($tokenlife, "CREATE_CONTACTS"); $o->bpartnerctrl = $ctrl->getSelectBPartner($o->bpartner_id, 'N'); $o->countryctrl = $ctrl->getSelectCountry($o->country_id, 'Y'); $o->addressctrl = $ctrl->getSelectAddress($o->address_id, 'Y', "", $o->bpartner_id); $o->userctrl = $ctrl->getSelectUsers($o->uid, 'Y'); $o->regionctrl = $ctrl->getSelectRegion($o->region_id, 'Y'); $o->getInputForm("edit", $o->contacts_id, $token); // $o->showContactsTable("WHERE contacts_id>0 and organization_id=$defaultorganization_id","ORDER BY defaultlevel,contacts_name"); } else { //if can't find particular organization from database, return error message redirect_header("contacts.php", 3, "Some error on viewing your contacts data, probably database corrupted"); } break; //when user request to edit particular organization //when user request to edit particular organization case "update":
$log->saveLog($latest_id, $tablefollowup, $o->updatesql, "I", "O"); redirect_header("bpartner.php?action=view&bpartner_id={$o->bpartner_id}", $pausetime, "Your data is saved, redirect to create more record."); } else { $log->saveLog(0, $tablefollowup, $o->updatesql, "I", "F"); redirect_header("bpartner.php?action=view&bpartner_id={$o->bpartner_id}", $pausetime, "Warning! Your data cannot saved, redirect to business partner"); } } else { redirect_header("bpartner.php?action=view&bpartner_id={$o->bpartner_id}", 3, "Cannot save followup due to token expired."); } break; //when user request to edit particular organization //when user request to edit particular organization case "edit": if ($o->fetchFollowUp($o->followup_id)) { //create a new token for editing a form $token = $s->createToken($tokenlife, "CREATE_FOLLOWUP"); $o->bpartnerctrl = $ctrl->getSelectBPartner($o->bpartner_id, 'N'); $o->countryctrl = $ctrl->getSelectCountry($o->country_id, 'Y'); $o->followuptypectrl = $ctrl->getSelectfollowuptype($o->followuptype_id, 'Y'); $o->userctrl = $ctrl->getSelectUsers($o->uid, 'Y'); $o->regionctrl = $ctrl->getSelectRegion($o->region_id, 'Y'); $o->employeectrl = $ctrl->getSelectemployee($o->employee_id, "Y"); $o->religionctrl = $ctrl->getSelectReligion($o->religion_id, "Y"); $o->getInputForm("edit", $o->followup_id, $token); // $o->showFollowUpTable("WHERE followup_id>0 and organization_id=$defaultorganization_id","ORDER BY defaultlevel,followup_name"); } else { //if can't find particular organization from database, return error message redirect_header("followup.php", 3, "Some error on viewing your followup data, probably database corrupted"); } break; //when user request to edit particular organization