rendered paste body<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
require_once("../dbOracleConnect.php");
require_once("../Caching.php");
$holds = $cache->get('hold_status');
?>
<div style="height:100%" xmlns="http://www.w3.org/1999/xhtml" xmlns:b="http://www.backbase.com/b" xmlns:s="http://www.backbase.com/s">
<s:behavior b:name="goto_song_song_onclick">
<s:event b:on="command">
<?php if ($_GET[abbr_song]) { //if this is popped up from the abbreviated song page?>
<s:task b:action="trigger" b:event="close" b:target="id('full_screen_modal')" />
<s:execute b:behavior="song_submit_forms"/>
<s:task b:action="load" b:url="song/SongConvertToSong.php" b:destination="id('bogus_modal')" b:data="{concat('copy_song_id=',@song_id,'&song_id=<?php echo $_GET[song_id];?>&song_sequence_id=<?php echo $_GET[sequence_id];?>&as_copy=Y')}"/>
<?php } elseif ($_GET[prod]){ //from the song general page ?>
<s:task b:action="trigger" b:event="close" b:target="id('full_screen_modal')" />
<s:task b:action="set" b:target="id('song_general_prod_id')/@value" b:value="{@song_id}"/>
<s:task b:action="set" b:target="id('song_general_prod_nm')/@value" b:value="{@title_tx}"/>
<s:task b:action="set" b:target="id('song_general_prod_seq_id')/@value" b:value="0" />
<?php } elseif ($_GET[mp_song]){
//if this is popped up from the mechanical product song?>
<s:variable b:name="songId" b:scope="local" b:value="{@song_id}" />
<s:choose>
<s:when b:test="id('license_mp_general_song_tbody')/tr/td[@song_id = $songId]">
<s:task b:action="alert" b:value="That Song has already been selected. Please select another." />
</s:when>
<s:otherwise>
<s:task b:action="trigger" b:event="close" b:target="id('full_screen_modal')" />
<s:render b:destination="id('license_mp_general_song_tbody')" b:mode="asfirstchild">
<tr b:behavior="hover_click_table">
<input b:behavior="license_mp_general_song_changed" type="hidden" name="song_id[]" value="" />
<input type="hidden" name="song_sequence_id[]" value="" />
<input type="hidden" name="controlled_pc[]" value="" />
<input type="hidden" name="collectable_pc[]" value="" />
<input type="hidden" name="mechanical_product_song_id[]" value="0" />
<input type="hidden" name="iswc_cd[]" value="" />
<td><input type="checkbox" name="selected_song" value="Y"/></td>
<td><s:textnode b:label="{@song_id}" /></td>
<td><s:textnode b:label="{@title_tx}"/></td>
<td cat="mp_song_writers_nm"></td>
<td cat="mp_song_controlled_pc"></td>
<td cat="mp_song_collectable_pc"></td>
<td cat="mp_song_song_status"></td>
</tr>
</s:render>
<s:task b:action="load" b:url="license/LicenseMPSongCalculatedResult.php" b:destination="id('bogus_modal')" b:data="{concat('song_id=',@song_id,'&song_sequence_id=',@sequence_id)}"/>
</s:otherwise>
</s:choose>
<?php } elseif ($_GET[license_song]){
//if this is popped up from the license karaoke
$licenseHeaderProductNo = $_GET[license_header_product_no];
?>
<s:variable b:name="songId" b:scope="local" b:value="{@song_id}" />
<s:choose>
<s:when b:test="id('license_product_song_table')/tbody[@song_license_header_product_no = <?php echo $licenseHeaderProductNo; ?>]/tr/td[@song_id = $songId]">
<s:task b:action="alert" b:value="That Song has already been selected. Please select another." />
</s:when>
<s:otherwise>
<s:task b:action="trigger" b:event="close" b:target="id('full_screen_modal')" />
<s:render b:destination="id('license_product_song_table')/tbody[@song_license_header_product_no = <?php echo $licenseHeaderProductNo; ?>]" b:mode="asfirstchild">
<tr b:behavior="hover_click_table">
<input type="hidden" name="new_product_song[]" value="Y" />
<input type="hidden" name="song_id[]" value="" />
<input type="hidden" name="song_sequence_id[]" value="" />
<input type="hidden" name="song_license_header_product_no[]" value="{id('map_license_product_table')/tbody/tr[@product_license_header_product_no = <?php echo $licenseHeaderProductNo; ?>]/td[2]/input/@value}" />
<input type="hidden" name="controlled_pc[]" value="" />
<td><input type="checkbox" name="selected_song" value="Y"/></td>
<td license_header_product_no="<?php echo $licenseHeaderProductNo;?>"><s:textnode b:label="{@song_id}" /></td>
<td license_header_product_no="<?php echo $licenseHeaderProductNo;?>"><s:textnode b:label="{@title_tx}"/></td>
<td cat="license_song_writers_nm" license_header_product_no="<?php echo $licenseHeaderProductNo;?>"></td>
<td cat="license_song_controlled_pc" license_header_product_no="<?php echo $licenseHeaderProductNo;?>"></td>
<td cat="license_song_artist" license_header_product_no="<?php echo $licenseHeaderProductNo;?>">
<input b:behavior="license_general_song_changed" type="text" name="artist_name_tx[]" value="" />
</td>
</tr>
</s:render>
<s:task b:action="load" b:url="license/LicenseKaraokeSongCalculatedResult.php" b:destination="id('bogus_modal')" b:data="{concat('song_id=',@song_id,'&song_sequence_id=',@sequence_id,'&license_header_product_no=',<?php echo $licenseHeaderProductNo; ?>)}"/>
</s:otherwise>
</s:choose>
<?php } elseif ($_GET[sync_license_song]){ //if this is popped up from the sync license general?>
<s:task b:action="trigger" b:event="close" b:target="id('full_screen_modal')" />
<s:script>
<!--
_vars['sync_license_song_id'][0].value = _current.getAttribute('song_id');
_vars['sync_license_song_tx'][0].value = _current.getAttribute('title_tx');
_vars['sync_license_song_writer'][0].value = _current.getAttribute('writers');
_vars['sync_license_song_publisher'][0].value = _current.getAttribute('publishers');
-->
</s:script>
<?php } elseif ($_GET[mp_song]){ //if this is popped up from the mechanical product song ?>
<s:task b:action="trigger" b:event="close" b:target="id('full_screen_modal')" />
<s:render b:destination="id('license_mp_general_song_tbody')" b:mode="asfirstchild">
<s:textnode b:label="{@song_id}" />
<s:textnode b:label="{@title_tx}"/>
<s:textnode b:label="{@writers}"/>
<s:textnode b:label="{@publishers}"/>
<?php } elseif ($_GET[plr_song]){ //if this is popped up from the mechanical upload song matching ?>
<s:task b:action="trigger" b:event="close" b:target="id('full_screen_modal')" />
<? if ($_GET[workno]) { ?>
<s:task b:action="settext" b:target="id('songs_results_body')/tr[@workno='<?php echo $_GET[workno];?>']/td[3]/div" b:value="{concat(@title_tx,'(',@writers,')')}" />
<s:task b:action="settext" b:target="id('songs_results_body')/tr[@workno='<?php echo $_GET[workno];?>']/td[4]/div" b:value="{@song_id}" />
<s:task b:action="set" b:target="id('songs_results_body')/tr[@workno='<?php echo $_GET[workno];?>']/@tempo_id" b:value="{@song_id}" />
<? } else { ?>
<s:task b:action="settext" b:target="id('songs_results_body')/tr[@b:state='selected']/td[3]/div" b:value="{concat(@title_tx,'(',@writers,')')}" />
<s:task b:action="settext" b:target="id('songs_results_body')/tr[@b:state='selected']/td[4]/div" b:value="{@song_id}" />
<s:task b:action="set" b:target="id('songs_results_body')/tr[@b:state='selected']/@tempo_id" b:value="{@song_id}" />
<? } ?>
<s:task b:action="load" b:url="plr/PLRSongsMatchModify.php" b:data="{concat('tempo_id=',@song_id,'&song_sequence_id=',@sequence_id,'&plr_song_title=<?php echo htmlentities($_GET[plr_song_title]);?>&workno=<?php echo $_GET[workno];?>&plr_product_id=<?php echo $_GET[plr_product_id];?>&plr_writer=<?php echo $_GET[plr_song_writer];?>')}"/>
<?php } elseif ($_GET[cwr_song]) { //if popped up from cwr_song page ?>
<s:task b:action="trigger" b:test="id('full_screen_modal')/@b:open='true'" b:event="close" b:target="id('full_screen_modal')" />
<s:task b:action="set" b:target="$cwr_song_id/@value" b:value="{@song_id}" />
<s:task b:action="set" b:target="$cwr_song_sequence_id/@value" b:value="{@sequence_id}" />
<s:task b:action="set" b:target="$cwr_song_tx/@value" b:value="{concat(@song_id,' - ',@title_tx)}" />
<?php } else { //if this is popped up from the music usage page?>
<s:task b:action="trigger" b:event="close" b:target="id('full_screen_modal')" />
<s:task b:action="set" b:target="$song_mu_usage_title/@value" b:value=""/>
<s:script><!-- _vars['song_mu_title'][0].value = _current.getAttribute('title_tx') --></s:script>
<!-- <s:task b:action="set" b:target="$song_mu_title" b:value="{concat(@song_id,' - ',@title_tx)}"/>-->
<s:task b:action="set" b:target="id('song_mu_tbody')/tr[@unique= '<?php echo $_GET[unique];?>']/td[3]/input[1]/@b:state" b:value="selected" />
<s:task b:action="set" b:target="$song_mu_id/@value" b:value="{@song_id}"/>
<s:task b:action="hide" b:target="id('song_mu_tbody')/tr[@unique= '<?php echo $_GET[unique];?>']/td[@cat = 'writers']/b:button | id('song_mu_tbody')/tr[@unique= '<?php echo $_GET[unique];?>']/td[@cat = 'writers']/a"/>
<s:variable b:name="writers" b:value="{@writers}" b:scope="global" />
<s:if b:test="string-length($writers) > 35">
<s:variable b:name="writers" b:scope="global" b:select="concat(substring($writers,1,35),'...')" /><!-- add '...' and conactenate if string is too large-->
</s:if>
<s:task b:action="set" b:target="id('song_mu_tbody')/tr[@unique= '<?php echo $_GET[unique];?>']/td[@cat = 'writers']/span[@cat='inc_writers']/@b:tooltiptext" b:value="{@writers}" />
<s:task b:action="set" b:target="id('song_mu_tbody')/tr[@unique= '<?php echo $_GET[unique];?>']/td[@cat = 'writers']/input[@cat='writers']" b:value="" />
<s:task b:action="settext" b:target="id('song_mu_tbody')/tr[@unique= '<?php echo $_GET[unique];?>']/td[@cat = 'writers']/span[@cat='inc_writers']" b:value="{$writers}" />
<s:task b:action="focus" b:target="id('song_mu_tbody')/tr[@unique= '<?php echo $_GET[unique];?>']/td[@cat='time']/input[@cat='hours']" />
<s:task b:action="focus" b:target="id('song_mu_tbody')/tr[@unique= '<?php echo $_GET[unique];?>']/td[@cat='time']/input[@cat='hours']" />
<?php } ?>
</s:event>
</s:behavior>
<s:execute>
<s:render b:destination="id('full_screen_modal_all')" >
<b:modalhead>Song Search</b:modalhead>
<b:modalbody>
<form id="song_song_search_form" b:destination="id('song_song_search_results_body')" b:mode="replace" action="song/SongSongSearchResult.php" method="get">
<s:whenactive><!-- submit form when enter key is pressed -->
<s:keys b:keys="13" b:action="trigger" b:event="command" b:target="id('song_song_search_button')" />
</s:whenactive>
<table id="song_song_search_table" style="width:100%;">
<tbody>
<tr style="height:4px"><td colspan="6"></td></tr>
<tr style="background-color: #E1E1E1; ">
<td>Title</td>
<td style="width:5%">Number</td>
<td>Writer Name</td>
<td>Publisher Name</td>
<td><table style="width:100%"><tr><td>Client No</td><td b:action="show-hide" b:target="a | id('song_song_search_table')//tr/td[6] | id('song_song_search_table')//tr/td[7]" align="right"><a b:action="set" b:target="id('song_song_button_row')/@colspan" b:value="7">more <<</a><a b:action="set" b:target="id('song_song_button_row')/@colspan" b:value="5" style="display:none;">less >></a></td></tr></table></td>
<td style="display:none;">Priority</td>
<td style="display:none;">Current User</td>
</tr>
<tr style="background-color: #AFAFD8; ">
<td>
<input style="width:100%;" search_field="Y" type="text" name="SONG_TITLE" id="song_song_search_title" value=""/>
</td>
<td><input search_field="Y" id="song_song_search_song_id" type="text" name="SONG_ID" value="" style="width:100px;"/></td>
<td>
<input style="width:100%;" search_field="Y" type="text" name="WRITER_NAME" value=""/>
</td>
<td>
<input search_field="Y" style="width:100%;" type="text" name="PUBLISHER_NAME" value=""/>
</td>
<td><input search_field="Y" type="text" name="CLIENT_ID" value="" style="width:100px"/></td>
<td style="display:none;">
<b:select search_field="Y" b:name="PRIORITY_CD">
<b:option b:value=""></b:option>
<b:option b:value="1">Super High</b:option>
<b:option b:value="2">High</b:option>
<b:option b:value="3">Medium</b:option>
<b:option b:value="4">Low</b:option>
</b:select>
</td>
<td style="display:none;"> <input search_field="Y" type="text" name="CURRENT_USER" value="" style="width:100px"/>
</td>
</tr>
<tr style="background-color: #E1E1E1; ">
<td>Originating Office</td>
<td >Type</td>
<td>Company</td>
<td>Artist</td>
<td>Client Name</td>
<td style="display:none;">Current Status</td>
<td style="display:none;">Modified User</td>
</tr>
<tr style="background-color: #AFAFD8; ">
<td><b:select search_field="Y" b:name="ORIG_OFFICE_ID" id="song_song_search_orig_office">
<s:event b:on="change">
<s:choose>
<s:when b:test="@b:value = ''">
<s:task b:action="show" b:target="id('song_song_search_company_cd')/b:option" />
</s:when>
<s:otherwise>
<s:with b:target="id('song_song_search_company_cd')/b:option[@orig_office != id('song_song_search_orig_office')/@b:value]" >
<s:task b:action="hide" b:target="." />
<s:if b:test="id('song_song_search_company_cd')/@b:value = @b:value">
<s:task b:action="set" b:target="id('song_song_search_company_cd')/@b:value" b:value="" />
<s:task b:action="set" b:target="id('song_song_search_company_cd')/@b:text" b:value="" />
</s:if>
</s:with>
<s:task b:action="show" b:target="id('song_song_search_company_cd')/b:option[@orig_office = id('song_song_search_orig_office')/@b:value]" />
</s:otherwise>
</s:choose>
</s:event>
<b:option b:value=""></b:option>
<?php
$offices = $cache->get('orig_office');
foreach($offices As $office)
{
if ($office[ORIG_OFFICE_ID] == $_SESSION[defaultOffice] && $_SESSION[center] != 'Y') //if this is the user's default office and the user is not a center user
{
echo '<b:option b:state="selected" b:value="'.$office[ORIG_OFFICE_ID].'">'.htmlentities($office[ORIG_OFFICE_NM]).'</b:option>';
}
else
{
echo '<b:option b:value="'.$office[ORIG_OFFICE_ID].'">'.htmlentities($office[ORIG_OFFICE_NM]).'</b:option>';
}
}
?>
</b:select></td>
<td>
<?php if ($_GET[prod]) { ?>
<b:select b:name="SONG_TYPE_ID" search_field="Y">
<b:option b:value="0">All Productions</b:option>
<b:option b:value="2">Production</b:option>
<b:option b:value="3">Episodic Production</b:option>
</b:select>
<?php } else { ?>
Song
<input type="hidden" name="SONG_TYPE_ID" value="1" />
<?php } ?>
</td>
<td>
<input style="width:100%;" search_field="Y" type="text" name="COMPANY_NAME" value="" />
</td>
<td> <input style="width:100%;" search_field="Y" type="text" name="ARTIST_NAME" value="" /></td>
<td> <input style="width:100%;" search_field="Y" type="text" name="CLIENT_NAME" value="" /></td>
<td style="display:none;">
<b:select b:name="STATUS" search_field="Y">
<b:option b:value=""></b:option>
<b:option b:value="1">Local Pending</b:option>
<b:option b:value="2">Local Submitted</b:option>
<b:option b:value="3">Local Approved</b:option>
<b:option b:value="4">Pending</b:option>
<b:option b:value="5">Submitted</b:option>
<b:option b:value="6">Approved</b:option>
<b:option b:value="8">Rejected</b:option>
<b:option b:value="9">Reassigned</b:option>
<b:option b:value="10">Discarded</b:option>
</b:select>
</td>
<td style="display:none;"><input type="text" search_field="Y" name="MODIFIED_USER" value="" style="width:100px"/>
</td>
</tr>
<tr>
<td>
<input type="hidden" name="searched" value="yes" />
<input type="hidden" name="workflow_ind" id="song_song_search_workflow_ind" value="N" />
<s:execute><s:variable b:name="dont_open" b:value="0" b:scope="global" /></s:execute>
<b:button b:action="submit" id="song_song_search_button" b:target="id('song_song_search_form')">Search
<?php if ($_GET[plr_song]) {?>
<s:execute>
<s:task b:action="set" b:target="id('song_song_search_title')/@value" b:value="<?php echo htmlentities($_GET[plr_song_title]);?>"/>
<s:task b:action="submit" id="song_song_search_button" b:target="id('song_song_search_form')"/>
<s:task b:action="trigger" b:test="id('full_screen_modal')/@b:open='true'" b:event="close" b:target="id('full_screen_modal')" />
</s:execute>
<?php } ?>
<?php if ($_GET[song_mu]) {?>
<s:execute>
<s:task b:action="set" b:target="id('song_song_search_title')/@value" b:value="<?php echo htmlentities($_GET[mu_title_tx]);?>"/>
<s:task b:action="submit" id="song_song_search_button" b:target="id('song_song_search_form')"/>
<s:task b:action="trigger" b:test="id('full_screen_modal')/@b:open='true'" b:event="close" b:target="id('full_screen_modal')" />
</s:execute>
<?php } ?>
<?php if ($_GET[cwr_song]) {?>
<s:execute>
<?php if (is_numeric($_GET[cwr_song])) { ?>
<s:task b:action="set" b:target="id('song_song_search_song_id')/@value" b:value="<?php echo $_GET[cwr_song];?>"/>
<?php } else { ?>
<s:task b:action="set" b:target="id('song_song_search_title')/@value" b:value="<?php echo htmlnumericentities($_GET[cwr_song]);?>"/>
<?php } ?>
<s:task b:action="submit" id="song_song_search_button" b:target="id('song_song_search_form')"/>
<s:task b:action="trigger" b:test="id('full_screen_modal')/@b:open='true'" b:event="close" b:target="id('full_screen_modal')" />
</s:execute>
<?php } elseif ($_GET[prod]) { ?>
<s:execute>
<?php if (is_numeric($_GET[prod])) { ?>
<s:task b:action="set" b:target="id('song_song_search_song_id')/@value" b:value="<?php echo $_GET[prod];?>"/>
<?php } else { ?>
<s:task b:action="set" b:target="id('song_song_search_title')/@value" b:value="<?php echo htmlnumericentities($_GET[prod]);?>"/>
<?php } ?>
<s:task b:action="submit" id="song_song_search_button" b:target="id('song_song_search_form')"/>
<s:task b:action="trigger" b:test="id('full_screen_modal')/@b:open='true'" b:event="close" b:target="id('full_screen_modal')" />
</s:execute>
<?php } ?>
</b:button>
<b:button b:action="trigger" b:event="close" b:target="id('full_screen_modal')">Cancel
<s:event b:on="command">
<s:task b:action="deselect" b:target="id('song_mu_tbody')/tr[@unique= '<?php echo $_GET[unique];?>']/td[4]/input[1]" />
<s:task b:action="trigger" b:event="command" b:target="id('song_mu_tbody')/tr[@unique= '<?php echo $_GET[unique];?>']/td[4]/input[1]" />
</s:event>
</b:button>
</td>
</tr>
</tbody>
</table>
</form>
<div onscroll="setHeaders(this,5);" id="song_song_search_results_div" style="overflow:auto; width:100%; height: 75%; border-width:1px; border-style:solid">
<table style="width:99%;" id="song_song_search_results_listgrid" b:behavior="b-listview">
<thead>
<tr >
<th nosort="true" ></th>
<th >Office<br/>Type</th>
<th >Title (No.)</th>
<th >Writer Name</th>
<th >Publisher Name</th>
<th >Client Name (No.)</th>
<th style="width:130px;">Company<br/>Artist</th>
<th >Priority<br/>Status</th>
<th >Current User<br/>Mod. User</th>
</tr>
</thead>
<tbody id="song_song_search_results_body">
</tbody>
</table>
</div>
</b:modalbody>
</s:render>
<s:task b:test="count(id('song_song_search_results_body')/tr[not(@cat='alias')]) != '1'" b:action="trigger" b:event="open" b:target="id('full_screen_modal')" />
<s:task b:action="focus" b:target="id('song_song_search_title')" />
</s:execute>
</div>