working on it ...

Filters

Explore Public Snippets

Sort by

Found 41 snippets matching: ucm

    public by lbottaro  529684  10  8  0

    How to get the list of all the activities comparing two UCM streams in python

    This script shows how to get the list of all the activities comparing two ucm streams. The command returns a list object you can easily loop and print.
    import os
    
    bl_old="myOldBaseline@/MyVobs"
    bl_new="myNewBaseline@/MyVobs"
    myView = "MyView"
    
    diff_act=os.popen("cleartool setview -exec \"cleartool diffbl -nmerge -activities "+bl_old+" "+ bl_new+" \" " +myView).readlines()
    
    for act in diff_act:
      print ("ACTIVITY: "+str(act))
    

    public by lbottaro  14521  56  8  0

    How to list files changed in clearcase ucm stream activities

    This script lists the files changed in all the activities delivered on a specific stream, with no duplicates. The stream is the one currently set on the clearcase view.
    #!/usr/bin/tcsh -f
    # This script lists the activities of a stream and saves on the following file the changed files without duplicates.
    
    set tmpoutput = "$HOME/.tmp_AllChangedFilesInStream.txt"
    set output = "$HOME/AllChangedFilesInStream.txt"
    rm -rf $tmpoutput
    touch $tmpoutput
    rm -rf $output
    touch $output
    
    foreach act ( `cleartool lsact -s | grep -v rebase` )	
        set changeset = `cleartool lsact -fmt "%[versions]p" $act`
        echo $changeset | tr ' ' '\n' >> $tmpoutput
    end
    
    foreach line ( "`cat $tmpoutput`" )	
        set file=`echo $line | sed -e "s|\(.*\)@@.*|\1|"`
        
        set isPresent = `grep "$file" "$output"`
        if ("$isPresent" == "") then
          echo $file >> $output
        endif  
    end
    
    rm -rf $tmpoutput
    
    exit 0

    public by lbottaro  7243  4  7  0

    Make UCM clearcase activity using cleartool command

    Here are some examples on how to make, create and set activity in IBM Clearcase UCM environment, using cleartool mkact command. Source: http://www.ipnom.com/ClearCase-Commands/mkactivity.html
    # Create an activity, but do not set it to be the current activity for the view.
    # User is prompted to proceed 
    cleartool mkact –nset 
    Create activity with automatically generated name?  [yes] yes
    Created activity "activity990917.133218".
    
    # Create and set an activity attached to the current view.
    cleartool mkact new_activity 
    Created activity "new_activity".
    Set activity "new_activity" in view "java_int".
    
    # Create and set an activity whose name is generated automatically. 
    # User is not prompted for confirmation.
    cleartool mkact -f 
    Created activity "activity990917.134751".
    Set activity "activity990917.134751" in view "java_int".
    
    # Create and set an activity with the headline “Create directories”.
    cleartool mkactivity -headline "Create directories" create_directories 
    Created activity "create_directories". 
    Set activity "create_directories" in view "webo_integ".

    public by lbottaro  4139  4  6  0

    How to get the foundation baseline of a given UCM stream

    This python script will detect the foundation baseline of a given Clearcase UCM stream.
    import os
    
    working_stream = "myStream"
    pvob = "MyVobs"
    foundation_bl = os.popen("cleartool descr -fmt \"%[found_bls]CXp\" stream:"
            + working_stream + "@" + pvob).readlines()[0].split(":")[1].split("@")[0]
    print "Found Foundation baseline = " + str(foundation_bl)
    

    public by lbottaro  3649  1  7  1

    How to get the baselines from UCM stream in python

    This simple python script will detect the baselines configured on a given UCM Clearcase stream. At the end it will print the latest baseline found.
    import os
    stream = "myStream@/myVobs"
    latest_bl=os.popen("for a in `cleartool lsstream -fmt \"%[latest_bls]p\" " + 
                       stream + "`; do echo $a; done").readlines()
       print "Latest baseline found = " + str(latest_bl)

    external by Github  11  0  1  0

    Which year are you in? http://www.asesoresdr.com.mx/cheap-generic-seroquel.pdf seventy same seroquel 250 mg cleared “We literally all started crying when he came out,” UCM graduate Cassie Burghoff said while sitting with seniors Caroline Bondi and...

    Which year are you in? http://www.asesoresdr.com.mx/cheap-generic-seroquel.pdf seventy same seroquel 250 mg cleared “We literally all started crying when he came out,” UCM graduate Cassie Burghoff said while sitting with seniors Caroline Bondi and McKinsey Jordan after the event. “It’s just a great moment in history. It is something you ma
    Which year are you in? http://www.asesoresdr.com.mx/cheap-generic-seroquel.pdf seventy same seroquel 250 mg cleared  “We literally all started crying when he came out,” UCM graduate Cassie Burghoff said while sitting with seniors Caroline Bondi and McKinsey Jordan after the event. “It’s just a great moment in history. It is something you may only get to be a part of once.”
     http://www.boatingindustry.ca/turmeric-curcumin-organic.pdf intentions turmeric curcumin herbal supplement gnc greeting  "The headline jobs figures may continue to be broadly positive but one only has to dig a little deeper into the statistics to see that millions of people are continuing to be hit by a combination of lack of jobs and a ceaseless sharp fall in the real value of their pay."
     
    
    

    external by dtbaker  417  6  3  0

    Sample PHP for AdminLTE UCM Dashboard Widget

    Sample PHP for AdminLTE UCM Dashboard Widget: widget_sample.php
    PHP
    <?php
    // this sample widget will show how many jobs were started in the last 7 days:
    
    if(class_exists('module_job',false) && module_job::can_i('view','Jobs')){
    	$jobs = module_job::get_jobs(array(
        'date_start_after'=>date('Y-m-d',strtotime('-7 days'))
      ),array('columns'=>'u.job_id'));
    	ob_start();
    	// icons from http://ionicons.com/
    	?>
    	<div class="small-box bg-aqua">
    	    <div class="inner">
    	        <h3>
    	            <?php echo count($jobs); ?>
    	        </h3>
    	        <p>
    	            <?php _e('Incomplete Jobs');?>
    	        </p>
    	    </div>
    	    <div class="icon">
    	        <i class="ion ion-document-text"></i>
    	    </div>
    	    <a href="<?php echo module_job::link_open(false);?>" class="small-box-footer">
    	        <?php _e('View Jobs');?> <i class="fa fa-arrow-circle-right"></i>
    	    </a>
    	</div>
    	<?php
    	$widgets[] = array(
    		'id'      => 'jobs_started',
    		'columns' => 4,  // 1, 2, 3 or 4 - which column group to add this widget to
    		'raw' => true, // output the raw HTML above as the widget. If this is false then the widget will get wrapped in a default box with a title.
    		'content' => ob_get_clean(),
    	);
    }
    
    

    external by PCabeza  256  1  3  0

    Tampermonkey script to find UCM ELP Sakai forums posts ranking, use from *forums* tab, or else it won't work

    Tampermonkey script to find UCM ELP Sakai forums posts ranking, use from *forums* tab, or else it won't work: ELPRank.user.js
    // ==/UserScript==// ==UserScript==
    // @name         ELPRank
    // @namespace    https://gist.github.com/43dc185975386ab5eedf
    // @version      1.1
    // @description  To find UCM ELP Sakai forum posts ranking, use from *forums* tab, or else it won't work
    // @author       Pablo Cabeza
    // @match        https://cv3.sim.ucm.es/portal/site/*
    // @grant        none
    // @require http://code.jquery.com/jquery-latest.js
    // @require http://cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js
    // @resource DataTablesCSS http://cdn.datatables.net/1.10.4/css/jquery.dataTables.css
    // ==/UserScript==
    
    window.CVUTILS = (function() {
        // Link element to datatable css stylesheet
        // it is this way because GM_getResourceText dind't work
        var datatablescss = "<link rel='stylesheet' href='https://cdn.datatables.net/1.10.4/css/jquery.dataTables.css' type='text/css' media='screen'>"
    
        // Minimized version of the style that is at the bottom of the file
        var mystyle = '#special-button{border:solid #767676;border-radius:100%;bottom:30px;display:table;height:46px;left:30px;padding:4px;position:fixed;transition:padding 0.1s,left 0.1s,bottom 0.1s;width:46px}#special-button:hover{cursor:pointer}#special-button:active,#special-button:focus{bottom:32px;left:32px;padding:2px}#special-button .inner{background-color:#cbcbcb;border-radius:100%;color:solid #767676;display:table-cell;font-size:40px;text-align:center;vertical-align:middle}#special-container{background-color:rgba(0,0,0,0.317647);height:100%;left:0;padding-top:50px;position:fixed;top:0;width:100%}#special-container>*{background-color:white;margin:0 auto;max-height:60%;max-width:800px;overflow:scroll;padding:30px;width:80%}';
    
    
        // Extra elements added to the page to make it work
        var button = $('<div id="special-button"><div class="inner">π</div></div>');
        var container = $('<div id="special-container"><div class="special-table-wrapper"><table  class="display"><thead><tr><th>Nombre</th><th>Mensajes</th></thead></tr><tbody></tbody></table></div></div>');
    
        // Regex to extract the content of the body of a web page html
        var body_regex = /<body[^>]*>([\s\S]*)<\/body>/;
    
    
        var baseurl, listurl; // urls extracted from sakai forum frame
        var peoples=[], headers, nameidx, numidx;
        
    
        /**
           This function retrieves the paginated user list from listurl,
           extracts (user names,number of messages) in forum and iterates
           until all user data is fetched, it then calls callback with
           that data.
    
           The data is stored in the form of [name,number] in peoples
           variables.
        */
        function listUsers(callback,page) { 
    	page = page*1 || 0;
            var url=listurl + (page ? "/"+(page*30) : "") + ".page";
    
            console.log("Calling: ",url);
        	var call = $.ajax ( {
                type:       'GET',
                url:        url,
                async:      true,
                success:    function (responseText) {
                    var content = body_regex.exec(call.responseText)[1];
    
    		// Use this auxiliary node to parse html
                    var output = $('<output>').append($.parseHTML(content))                
    
    		// Get all rows form the table that contains user data
                    var trs = $('table.forumline',output).last().find('tr');
                    
    		// Just update indices the first time
                    if(!page) {
                        headers = trs.first().find('th').map(function(idx,el) { 
    			return $(el).text().trim().toLowerCase(); 
    		    }).toArray();
                        nameidx = $.inArray("nombre",headers);
                   	    numidx = $.inArray("mensajes",headers);
                    }
    
    		// Append to people the parsed information from users
                    Array.prototype.push.apply(peoples,trs.slice(1).map(
    		    function(idx,tr) {
    			return [$(tr).find('td').map( 
    			    function(idx,el) { 
    				return $(el).text().trim().toLowerCase(); 
    			    })
    			    .filter(
    				function(idx){ 
    				    return (idx == nameidx) || (idx==numidx); 
    				}
    			    ).toArray()
    			];
                        }));
                    
    		// Find if this page is the last
                    var final = output.find("table a").filter(
    		    function(idx) { 
    			return $(this).text().trim().toLowerCase() == "siguiente";
    		    }
    		).length == 0;
                    
    
                    if(final) callback(peoples);
                    else listUsers(callback,page+1);
                }
            });
        }
    
        /**
           Append extra html elements and prepare events
         */
        function prepareHTML() {
    	// Add extra styles
            $('head').append('<style type="text/css">'+mystyle+'</style>');  
            $("head").append(datatablescss);
    
    
    
            $('body').append(button);
    	
            var populateTable = false; // To prevent populating table twice
            button.click(function() {
                var call = function(p){
    		// Prepare and sort user data
    		// $.grep() prevents empty results
                    people = $.map(
    		    $.grep(p,function(v,i) { return v.length == 2; }),
    		    function(v,i) {
    			return [[v[0],parseInt(v[1])]];   
                    }).sort(function(a,b){ return a[1]-b[1]; });
                    
    		// Print nice table into the console
                    console.table(people.reverse());
    
    		// Populate table using DataTables api
                    if(!populateTable)
                        $.each(people,function(i,v) {
                            container.find('table').dataTable().api().row.add(v);
                        });
                    populateTable=true;
    
    		// Draw table and show it
                    container.find('table').dataTable().api().draw();
                    container.show();
                };
    
    	    // Just call listUsers when there is no data
                if(!peoples.length) listUsers(call);
                else call(peoples);
            });
    
            $('body').append(container);
            container.hide();
    
    	// Modal-like hide the table
            container.click(function(){container.hide();});
            container.find('> *').click(function(e){e.stopPropagation();});
            
    	// Initialize DataTable in container
            container.find('table').DataTable({"order": [[ 1, "desc" ]]});
    
    	// Find target url for forums
            baseurl=$('iframe').attr('src').replace(/\?.*/,'');
            listurl= baseurl + "/user/list";
        }
    
        $(document).ready(function(){
            prepareHTML();
        });
    
        return {
    	button: button,
    	container: container,
    	listUsers: listUsers,
    	listurl: listurl,
        };
    })();
    
    
    /*
      Style used in the html elements, mystyle variable contains a
      minimized version of it
    */
    
    /*
      #special-button{
      border-radius: 100%;
      bottom: 30px;
      left: 30px;
      position: fixed;
      width: 46px;
      height: 46px;
      display: table;
      border: solid rgb(118, 118, 118);
      padding: 4px;
      transition: padding 0.1s, left 0.1s, bottom 0.1s;
      }
    
      #special-button:hover {
      cursor: pointer;
      }
    
      #special-button:active, #special-button:focus {
      padding: 2px;
      bottom: 32px;
      left: 32px;
      }
    
    
      #special-button .inner {
      border-radius: 100%;
      display: table-cell;
      text-align: center;
      vertical-align: middle;
      font-size: 40px;
      color: solid rgb(118, 118, 118);
      background-color: rgb(203, 203, 203);
      }
    
      #special-container {
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.317647);
      position: fixed;
      left: 0px;
      top: 0px;
      padding-top: 50px;
      }
    
      #special-container > * {
      max-width: 800px;
      width: 80%;
      margin: 0px auto;
      background-color: white;
      padding: 30px;
      max-height: 60%;
      overflow: scroll;
      }
    
    */
    
    
    

    external by dtbaker  172  0  2  0

    Example import a customer into UCM

    Example import a customer into UCM: ucm-customer-import.php
    <?php
    
    $customer_import = array(
    	'customer_name' => 'Test Customer Import',
    	'customer_extra' => array(
    		'Extra Key 1' => 'Extra Val 1',
    		'Extra Key 2' => 'Extra Val 2',
    		'Extra Key 3' => 'Extra Val 3',
    	),
    	'address' => array(
    		'line_1' => '123 Test Street',
    		'line_2' => '',
    		'suburb' => 'Test Suburb',
    		'state' => 'Test State',
    		'post_code' => '12345',
    	),
    	'contact' => array(
    		'name' => 'Joe',
    		'last_name' => 'Smith',
    		'email' => 'Phone',
    		'mobile' => '0412345678',
    	),
    );
    
    
    include('init.php'); // the UCM init code.
    
    
    $customer_id = $plugins['customer']->save_customer('new',array(
    	'customer_name' => $customer_import['customer_name']
    ));
    if(!$customer_id){
    	echo 'Failed to create customer';
    	exit;
    }
    
    if(!empty($customer_import['customer_extra'])) {
    	foreach ( $customer_import['customer_extra'] as $extra_key => $extra_val ) {
    		// Add the Medium extra field to that newly created customer
    		$extra_db = array(
    			'extra_key'   => $extra_key,
    			'extra'       => $extra_val,
    			'owner_table' => 'customer',
    			'owner_id'    => $customer_id,
    		);
    		$extra_id = update_insert( 'extra_id', false, 'extra', $extra_db );
    	}
    }
    if(!empty($customer_import['address'])) {
    	// Save the address for the customer
    	$customer_import['address']['owner_id'] = $customer_id;
    	$customer_import['address']['owner_table'] = 'customer';
    	$customer_import['address']['address_type'] = 'physical';
    	module_address::save_address( false, $customer_import['address'] );
    }
    
    if(!empty($customer_import['contact'])) {
    	// add the contact details to this customer record
    	$customer_import['contact']['customer_id'] = $customer_id;
    	$contact_user_id = $plugins['user']->create_user( $customer_import['contact'], 'signup' );
    	if($contact_user_id){
    		module_customer::set_primary_user_id($customer_id, $contact_user_id);
    	}
    }
    
    
    echo "Created a customer with ID $customer_id and a contact with ID $contact_user_id ";
    
    

    external by dtbaker  152  0  2  0

    Format the invoice number in UCM

    Format the invoice number in UCM: custom_invoice_number.php
    <?php
    
    // this changes the invoice number format to a 7 digit string padded with 0's at the start
    // example: instead of "Invoice #1" it will be "Invoice #0000007"
    // upload this file to a new folder called 'includes/plugin_custom_invoice_number/custom_invoice_number.php'
    
    
    if(!function_exists('custom_invoice_number')) {
    	function custom_invoice_number( $customer_id ) {
    
    		$invoice_number = module_config::c( 'invoice_incrementing_next', 1 );
    		// see if there is an invoice number matching this one.
    		$this_invoice_number = $invoice_number;
    		do {
    			$this_invoice_number_formatted = str_pad( $this_invoice_number, 7, '0', STR_PAD_LEFT );
    			$invoices                      = get_multiple( 'invoice', array( 'name' => $this_invoice_number_formatted ) );
    			//self::get_invoices(array('name'=>$invoice_prefix.$this_invoice_number)); //'customer_id'=>$customer_id,
    			if ( ! $invoices ) {
    				$invoice_number = $this_invoice_number;
    				break;
    			} else {
    				// an invoice exists with this same number.
    				// is it from last year?
    				$this_invoice_number ++;
    			}
    		} while ( count( $invoices ) );
    		module_config::save_config( 'invoice_incrementing_next', $invoice_number );
    
    		return $this_invoice_number_formatted;
    	}
    }
    
    
    • Public Snippets
    • Channels Snippets